converted from left to right in a one-to-one fashion. For example, y/abc/abc/will convert all lowercase a to a, lowercase B to B, and lowercase C to c.For example:[Plain] view plaincopy
Sed ' 1,20y/hrwang12/hrwang^$/' datafile
#将1到20行内, convert all lowercase hrwang to uppercase, convert 1 to ^, convert 2 to $.
#正则表达式元字符对y命令不起作用. As with the S command delimiter, the slash can be replaced with other characters.
12. Q CommandThe Q
2013 16:24:32 + 0800 Date: Wed, 20 Nov 2013 16:24:32 + 0800Message-Id:
To:
Subject: testX-Mailer: mail (GNU Mailutils 2.1) From: su1216
This is a test.
After completing the email, use ctrl + d to end the email.
Mutt(Using the ncurses library)
Graphical E-mail client
In the KDE window environmentKMail
In the GNOME window environmentEvolution
The above two are of little use in shell
"Linux Command Line and shell script programming Daquan" sed advanced multi-line command sed Editor contains three commands that can be used to process multi-line text 1.N: Add the next line in the data stream to create multiple row group to process 2.D: delete a row in a multi-row group 3.P: print the next
How scripts are executedFor example, we wrote a script under/root/, named Hello.sh. So how does the call execute it? There are two ways to do this:(1) Directly through bash, as follows:Bash hello.shNote: Execute scripts with bash and do not need to give execute permissions. But this does not conform to the habit, generally not recommended to use.(2) Give permission first, then call directly:chmod 755 hello.sh/root/hello.shNote: The first sentence abov
use external program files to run.(1) such as exit and CD are built-in commands$type exit$type CDSome commands have multiple implementations, such as PWD and Echo, which have both external and built-in commands#type-a EchoThe which only displays external command files.Type-a shows two implementations of each command.Tip: For multiple implementations of the command, the default execution is built-in, if you
Shell basic exercises: using the read interactive input, command-line script 2 ways to implement input 2 integer numbers, and calculate subtraction. The basic knowledge of shell includes: variable definition, read, if Judgment statement, regular expression and so on.
First way: Read Interactiv
ExitCommandExit The procedure used to control the program and the expression, there is an exit function in the General programming language, also exists in the Linuxshell.Exit 0Exit statusStatus A number between 0-255 indicates that the return status value is accompanied by the exit of the script (in fact, exit).Is that $? The value can be queried using echoExit The command is not the same on the
Linux command line and shell script programming Daquan create function basic script function create function 1. use the function keyword, followed by the function name [plain] functionname {commands} 2. the function name is followed by an empty parentheses, indicating that a function is being defined [plain] name ()...
Execute the system command and write the shell script that writes the output to the log file,
This is probably the requirement. Run the usysfault command on the aix system to retrieve the fault light information. However, it seems that only the root user can execute this command
execution result at this time is no different from the direct command execution in shell.Case 2: replace variablesWrite as follows:[[Email protected] shellscripts] # Cat 1.sh#! /Bin/bashDirpath =/home/shellscriptsCmd = "ls-L $ dirpath | awk-F ''' {print \ $9 }'"Eval $ cmd[[Email protected] shellscripts] #[[Email protected] shellscripts] #./1.sh1. ShTest. Sh[[Email protected] shellscripts] # ls-L/home/shellscripts/| awk-F ''' {print $9 }'1. ShTest. Sh
Linux Shell script series tutorial (2): terminal printing command details
This article mainly introduces the Linux Shell script series (2): terminal printing command details, this article focuses on echo terminal printing, printf
Label: 1. Open the Winows menu, enter the cmd command, click OK, and enter command mode. 2. Enter Command D: (the D here indicates that your SDK is stored under the disk) then enter the CD 3. Then select your SDK path and copy the path. 4. Click cmd on the mouse, select Edit, paste the copied path into the command line
Shell script execution error '\ 357 \ 273 \ 277': command not found solution, shell357
1. Delete the BOM and execute the following command under vi.
:set nobomb
2. cause:
The so-called BOM is the Byte Order Mark, which is a Unicode character that usually appears at the beginning of the text to identify the Byte Orde
= 0;i = 1; does {total + = $i; i++} while (total Gawk ' {total =0;-(i = 1;i Chapter 23rd using other shellsYou can try to learn to use zsh and support modularity.24th. Writing a simple script utilitySlightly25th. Create DATABASE, Web, and e-mail related scriptsThe side that writes the script to MySQL is available:MySQL mytest-u test Show tables;SELECT * FROM Employees where salary > 40000;Eofecho "This is
Tags: two functions bin root logic judge Custom Function Math Operation Mon Execution methodShell Script IntroductionShell is a scripting languageYou can use logical judgments, loops, and other syntaxFunctions can be custom-definedThe shell is a collection of system commandsShell scripts enable automated operations, which can greatly increase our operational efficiency
This article, as the last article in the Shell script Base series, does an exercise here. How to use a For loop to execute a command.
1. Use for loop to execute different commands
2.for loop Plus if statement print file
Put the script file under/etc, then perform a look at the effect, and then change-f in the
Early knowledge of sed and gawk in Linux Command Line and shell script ProgrammingThe sed editor of the Text Processing editor can process data in a data stream based on commands that are input to the command line or stored in the Command text file. It reads a row each time,
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.