Shell programming (chapter 1 of courseware)

============= Shell parameter passing ======================================P2[Soflib @ localhost ~] $ Cat ARGsEcho $ # arguments passedEcho Arg 1 =: $1, Arg 2 =: $2, Arg 3 =: $3[Soflib @ localhost ~] $./Args A B C3 arguments passedArg 1 =: A, Arg 2

Solve the Problem of garbled Chinese input in the shell environment (GIT-bash) of msysgit

InWindowsThe defaultMsysgitOfShellEnvironment (that isGitBash).ShellEnter Chinese characters in the interface and do some processing. 1 Methods of online circulation Modify configuration file\ Git \ etc \ inputrc, Add or modify the configuration

What is the difference between "in shell?

1. Difference between single quotes and double quotes Single quotation marks: A single quotation mark can only contain general characters without special characters. Double quotation marks include special characters. Example: # Name = vbird #

Use environment variables in makefile and Shell

Variables can be used in makefile by $ (VAR) or $ {var}. For details, refer: Http://blog.csdn.net/lovetangtang/archive/2005/12/31/567297.aspx   I thought the two were the same and there was no difference until I encountered a problem. Because of

Color Display and Behavior Control in Shell

The format is as follows: # Echo-e '\ 033 [background color; foreground color; action control M string \ 033 [# m'# Echo-e '\ e [background color; foreground color; action control M string \ e [# m' # Foreground | Background: Color#----------------

Shell tips for using wget commands

Wget is a command line download tool. Linux users are using it almost every day. The following describes some useful wget tips to help you use wget more efficiently and flexibly. $ Wget-r-NP-nd http://example.com/packages/ This command

Shell script learning-4 (* assignment result)

Let's take a look at the asterisk assignment:   [Rocrocket @ rocrocket ~] $ Myvar = * [Rocrocket @ rocrocket ~] $ Echo $ myvarApache-tomcat-5.5.26.tar.gz audiodump.wav desktop documents download dwhelper educonn.tar.gz music pictures public

One of shell Study Notes

1. First look at a common command PS-EDF | sort | uniq | grep-V sh | more This command combines several different shell commands, which have this feature. Uniformity and simplicity. You can use pipeline commands to combine multiple shell

Shell Selection Method

Enter the following command to understand the shell currently logged on: $ Echo $ Shell /Bin/bash The system uses bash shell. There are many other shells. You only need to enter the new shell command (Ksh, tcsh, CSH, sh, Bash, etc.) in the

Linux Shell syntax

Linux Shell is a powerful script program with simple syntax. The following is an executable sh script, covering common shell syntax and usage. Understanding it is equivalent to getting started.   #! /Bin/bash# Title:# Date :?# Author: Made by

Basic knowledge of shell scripts 2-Use structured commands

Structured commands: Allow scripts to skip or execute these commands cyclically based on the conditions of variable values or the results of other commands 1. Use the if_then statement If command Then Commands Fi Run the command after if first.

Shell programming in Linux-conditional Testing

  1.Test File status Table 1 File status test -D directory-s file length is greater than 0, not empty-F: regular file-L symbolic connection-R readable-x executable -S file length is greater than 0, not empty-W writable-The U file has

Shell-shell example

From: http://www.csdn.net/article/2013-08-15/2816581-What-I-learned-from-other-s-shell-scripts The author Fizer Khan is a shell script fan who is so obsessed with novel and interesting things about shell scripts. He recently encountered an authy-ssh

Linux get time in Shell

Obtain the date of the current day Date + % Y-% m-% d Output: 2011-07-28   Assign the current date to the date variableDate = $ (date + % Y % m % d) Sometimes we need to use the date before or after today, then we can use the-D parameter of

Shell beginners-several simple shell scripts

Example 1#! /Bin/shcase ${1 # *. Tar.} In bz2) tar jxvf $1; GZ) tar zxvf $1; *) echo "Wrong file type" esac$1 indicates the first command line parameter ${1 # *. Tar.} when running the script. It indicates that the first command line parameter is

Familiar with shell programming

This is the first thing I did in my company that is directly related to programming and requires shell commands. In fact, I feel that the shell under Linux is the same as the DOS batch processing under windows.   Question: 1. Use the shell language

Shell script learning-5 (SED command learning)

1 Have you ever wondered why SED is called sed? Sed is short for stream editor. Sed is a stream editor. To put it bluntly, we enter a string of information into SED, which is processed and output. That's simple. Similar to cut, sed is a row-oriented

Call a binary executable program (native executable) in Android-execute shell commands in code

A few days ago, when I needed to call the binary program in Java code, I found some information on the Internet and wrote something to record. Android is also a Linux-based system, and can also run binary executable files. However, Android only

Semi-manual shell scripts that allow remote hosts to trust each other for SSH connections (without passwords)

#!/bin/bash# trustme [remote user] [remote ip]# example:# trustme xxx 192.168.1.3local_user=`whoami`local_ip=`ifconfig|sed -n '/inet addr/s/^[^:]*:\([0-9.]\{7,15\}\) .*/\1/p'|sed -n 1p`remote_user=$1@$2key_path=/home/$1/# check my public keyif [ !

Start a shell script in APK

In Java, you can call the Execcommand method to run the shell script. The following is an example: 1 .#! /System/bin/sh 2. # The simplest shell with no function 3. # It must be noted that #! Start with/system/bin/sh (with spaces) 4. # different from

Total Pages: 541 1 .... 389 390 391 392 393 .... 541 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.