This article mainly introduces 2 methods of referencing and invoking another script file in the shell script, this article introduces the syntax of the two methods, then gives the actual usages and some places to pay attention to, the friend who
This article mainly introduces 4 methods of executing the shell script and the difference introduction, this article explained the relative path way, the absolute path way, the Bash command call, the relative or the absolute way as well as the next
This article mainly introduces the Linux Shell Script Series tutorial (four): Using functions to add environment variables, this paper introduces a knowledge of environment variables, and gives the general add environment variables and the use of
Because often use the shell script, so often will write some, but I have never systematically learned the shell script, encountered problems, go to the manual, or Google, to a certain extent to find their foundation is really bad. The following is a
Learn awk, you must remember to practice, only in practice to find problems, the following on my experience in learning and practice, summed up the difference between rs,ors,fs,ofs and contact.
One, RS and ors
1,rs is the record delimiter , the
Example one: Drawing special graphics
Copy Code code as follows:
#!/bin/bash
Max_no=0
Echo-n "Enter number between (5 to 9):"
Read Max_no
if! [$MAX _no-ge 5-a $MAX _no-le 9]; Then
echo "WTF ... I ask to enter number
Script 1: Write a login welcome script for root users:
1, with vi command in the/root directory is a new script file welcome.sh, the contents are as follows:
2, using the chmod command to welcome.sh file to increase the execution (x) permissions
Shell regular Expressions and grep awk find sed sort uniq cut
One, grep
1, basic parameters
GREP-[ACINV] ' search content string ' filename
-A text file search
-C calculates the number of matched rows found
-I ignores case
-N to output the
0. Initializing the Environment and OLE objects
#include #include // 初始化COM环境CoInitialize(NULL);// 创建Shell对象Variant vShellOLE = Variant::CreateObject("Shell.Application");
1. Cascade windows
1 execution of a sequence of commands[Email protected] log]# (A=2;echo $a)2[email protected] log]# {A=2;echo $a;} #注意格式的不同, with a space on the left and a semicolon ending at the far right2The redirection of a command within 2 () and {} Brackets
This article explains the advanced knowledge of shell variables.The following is a summary of the knowledge points, about the practice, this article does not involve, but also the small partners to practice their own!For special positional parameter
As a result of the work to cross-compile the application from the PC repeatedly, and through TFTP download to the ZYNQ board to run debugging. Repeated knocking commands are too cumbersome, so write a script to automate the download, change
One: Hello WorldCreate a new file, named after the. sh suffix. Each bash file begins with the first row of table names file type: #!/bin/bashThen enter the code below.For example, the output Hello World:#! /bin/"helloworld"Run Bash file:./file name.
Security code: Taohuatan depth thousand feet, less than mountain send Me love.File descriptor (FD): The file descriptor is a non-negative integer, and when you open an existing file or create a new file, the kernel returns aFile descriptors, and
Original: http://apps.hi.baidu.com/share/detail/31263915In the shell, the comparison between the string and the numerical method is different, pay attention to distinguishInteger comparison:-eq equals, such as: if ["$a"-eq "$b"]-ne not equal to,
The problem arises because the current release is used by executing scripts, all of which are mvn packaged, while execution causes problems.The solution checks, locks 、、、 before the script executes#!/bin/bash{flock -n 3 if [ $? -eq 1 ]then echo
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.