The rsh command is short for remote shell. This command starts a shell on the specified remote host and executes the command specified by the user in the rsh command line. If the user does not provide the command to be executed, RSH uses the rlogin
Simple usage
#! /Bin/sh (sleep 10; echo "username"; sleep 10; echo "password"; sleep 10; echo "PWD"; sleep 50; # echo exit) | Telnet $ IP
Connect to the remote machine and check the current directory.
Username/password is the username and
1,Echo $?: An exit status is returned when any command is running, and the exit status of the previous command is output,0Indicates that the exit is successful.
2, Test File status:[-W text]Test whether the file can be written,Echo $?The output is0
I want to perform frequent operations on a file. To obtain the values of different columns in each row, I know the method isWhile read lineDoEcho $ Line | awk '{print $1}' # obtain the value of the first column in each rowEcho $ Line | awk '{print $2
When learning Linux shell scripts, one of the most common errors is to useFor(For line in $ (cat file.txt) do ...) Read files row by row. The following example shows the result.
File file.txt content:
Cat file.txt
This is the Row No 1;
This is
Trap allows you to capture signals in the script. The common form of this command is:
Trap name signal (s)
Among them, name is a sequence of operations taken after the captured signal. In real life, name is generally a function specifically used
I. RequirementsWhenever you create, delete, or rename a folder/file in the Explorer window, or insert and remove a mobile storage, Windows can always update all its views very quickly. Sometimes our program also needs this feature so that our
I. Basics
We define a variable (there cannot be spaces on both sides of the equal sign)
Filepath =/var/home/SSSFilefilename = test001
When referencing this variable, we can directly use the variable name following $.
For example, $ filepathYou can
Linux running levelAfter Linux is started, it runs at one level. The following lists the running levels:0 system stopped1 single user system, no login required2 multi-user system, but does not support NFS, command line mode Login3 full multi-user
1. system environment variables after the user logs on to the system:$ Home user's own directory$ Path: the directory to be searched during Command Execution$ TZ Time Zone$ Mailcheck the number of seconds to check whether a new letter exists$ PS1
Observe the Oracle database performance. The AWR feature provided by Oracle provides us with a nearly perfect solution. With AWR features, we can extract AWR reports from the database at any time. However, we need to provide some interactive
Observe the Oracle database performance. The AWR feature provided by Oracle provides us with a nearly perfect solution. With AWR features, we can extract AWR reports from the database at any time. However, we need to provide some interactive
Go to: http://goward.jimdo.com/2010/06/15/linux-shell%E5%90%84%E7%A7%8D%E5%BC%95%E5%8F%B7%E7%9A%84%E7%94%A8%E6%B3%95/
The difference between these characters is how they affect variables (such as $ name) and shell commands (such as date ). For any
1. Embed shell Variables
1> cdpath: this variable retains some directory information, separated by the colon.
If this variable is set, shell will first find the value saved in this variable when a directory is stored in CD;
If the CD switch
If you need to perform operations on the base database in shell, you can first create a corresponding function, as shown in figure
Dbstr = "Tigger/pw123 @ orcl"
Exesql (){Sqlplus-S $ dbstr Set autocommit off;$1;Commit;Exit;EOF}
Phonelist = "1325
Compile a simple shell command parser
Environment:
RedHat 9.0 kernel 2.4.20
VI document editor 6.1.320
GCC 3.2.2-5
Steps:
Step 2: Write the simplest shell command interpreter. This program is taken from apue Example 1-5. The command cannot
This script is used to automatically back up version libraries under the svn directory and traverse the libraries through awk. The advantage of this is that when someone adds a new version library, there is no need to change the code, the program
#! /Bin/sh# The first line is to tell the system who will execute this dumb.
$ ## Number of parameters transferred to the script$ # ID of the current process during script running, often used as the suffix of temporary variables, such as haison. $$!
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