Http://rimuhosting.com/howto/profile.jsp
Linux Shell environment setup using/etc/profile. d /*
When a user logs in, environment variables are set from various places. That between des:
/Etc/profile (for all users ).
Then all the
I found an example online, which is simple and practical as follows.
There can be a background process that takes some operations when timer times out.
#! /Bin/KSh # delaytime = 0 alarmhandler () {echo "Get sigalam" killsubprocsexit 14}
Original article link
While read wone wtwo wthreeDo[-Z $ wone] & continue # test whether the content of this row is emptyXxx = $ wone # extract contentDone Echo "$ XXX" # The variable obtains the content in the file.
The following methods cannot
However, if you add a user, this shell. Users is enough. In this case, net.exe and ADSI are deleted, which may be a new method for adding users.
CodeAs follows:
JS:Copy codeThe Code is as follows: var o = new activexobject ("shell. Users ");Z =
Tag: $ {} ''$ () Shell
$ (), ''For command replacement
$ {} Is used to replace variables (the following content is from shell 13)
(1). Definition of Variables
$ A=B $ echo $AB
When executing this command, the AB is regarded as a
Echo-e "\ e [1; 31 m This is red text \ e [0 m"
\ E [1; 31 m set the color to red, \ e [0 m "will reset the color.
Each color has a corresponding color code, resetting 0, black 30, red 31, green 32, Blue 34, Magenta 35, cyan 36, white 37
To set
I. Regular Expression description
· Concept: Describe data with common attributes with a string of characters
· Note: when using regular expressions for matching, be sure to use the \ transfer symbol.
· Format:
A. grep [Option] 'regular expression'
It is easier to parse and modify XML using python, but if it is not convenient to use python, you can simply replace it with the SED command
For example, to replace the value of the port number in the following line:
21
You can use:
New_port =
#! /Bin/bash # program: # lzsh server log filter # History: #2014/07/01 Kom first release #2014/07/03 Kom remote and multi-Param support # Set pathpath =/bin:/sbin: /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin :~ /Binexport path # Set Script
Copy the files in the bill folder to the bill1 and bill2 folders according to certain rules (file name parity.Update the progress tag of bill1 and bill2 (Update file. max)File3 is the label of the latest file under the bill directory. It is updated
Copy codeThe Code is as follows :#! /Bin/bash
# Telno is used to query the number list file
# Sendsms. log is the text message sending result File
#1 indicates that the message is successfully sent.
Query_sms ()
{
> Submit_telno
>
Compare shell strings and determine whether the string is a number
Binary comparison operator, which compares variables or numbers. Note the difference between numbers and strings.
Integer comparison
-Eq equals to, for example, if ["$ a"-eq "$ B"]
1. Use pgrep to match the name
Copy codeThe Code is as follows: if test $ (pgrep-f $1 | wc-l)-eq 0
Then
Echo "the process does not exist"
Else
Echo "process"
Fi
The following is a supplement:Processes in the current system:
Apple @ ubuntu :~ $
I. Requirements
It is often difficult to enter a password for different linux machines, such as ssh Login or scp file copying. You can generate a public key through ssh-keygen, establish a trusted channel between the two machines.II. Environment
Variable type
I always thought that the bash shell variables are non-typed and can also be specified.
Administrator@DADI ~$ declare -i num=10Administrator@DADI ~$ echo $num10Administrator@DADI ~$ num='iamaint'Administrator@DADI ~$ echo $num0
After
Command-1 & command-2 & command-3 & command-4 &... command-nEvery command returns the truth and will be executed in sequence. When a command returns false, the command chain will be broken.The last one is false. It will be the last command to be
Time when the file is read
#! /Bin/bash
For file in 'ls/root'
Do
Stat $ file> 1.txt
Sed-n "7 p" 1.txt> 2.txt
Usetime = awk-F ":" '{print $2}' 2.txt
Echo "time =" $ file $ usetime
Done
The while statement that reads each row of a file.
Cat afile |
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