Reprinted statement: This blog article allow free reprint, but reprint need to indicate the author, source: Denny wqf363@hotmail.com Source: www.huntmine.com
Shell-specific variablesTable 14-2 specific s h e l variable $ # number of parameters passed to the script $ * displays all parameters passed to the script using a single string. Different from location variables, this option parameter can contain more than 9 $ ID of the current process in which the script runs $! Process I d of the last process running in the background $ @ is the same as $ #, but it is enclosed by quotation marks, and return each parameter in quotation marks. $-the current option used by s h e l is displayed. The function is the same as that used by s e t. $? Displays the exit status of the last command. 0 indicates no error, and any other value indicates an error. Use the functions in/etc/init. d/funtction to start, State, and stop the process.
Enable numlock automatically upon startup
For T in 'seq 1 8'
Do
Setleds-D + num
$ T>/dev/null
Done
The-D parameter can be used to change the default flags.
Of course, if you change num to caps, scroll can change the status of capslock and scrolllock. Note: Man setleds
In the shell program, 'Press any key'#! /Bin/sh
Get_char ()
{
Savedstty = 'stty-G'
Stty-echo
Stty raw
Dd If =/dev/tty BS = 1 COUNT = 1 2>/dev/null
Stty-raw
Stty echo
Stty $ savedstty
}
Echo "press any key to continue ..."
Char = 'get _ char 'Note: Man sttyHow to kill processes in batchesPS-Ef | grep Java | grep-V grep | awk '{print $2}' | xargs kill-9 start processes in batches
#! /Bin/sh
If [$ #-lt "4"]
Then
Echo usage: Process port username_start username_stop
Fi
Name = $1
I = $3
J = $4
Port = $2
While (I <j ))
Do
$ Name $ port user $ I arg1 arg2 &
(I ++ ))
(Port ++ ))
Done
Print directory tree#! /Bin/sh # dtree: Usage: dtree [any directory] dir =$ {1 :-.} (CD $ dir; PWD) find $ Dir-type D-print | sort-f | sed-e "s, ^ $1 ,, "-e"/^ $/D "-e" s, [^/] * // ([^/] */) $,/'----/1, "-e" s, [^/] */, |, G"