Bash warning - argument expected
http://stackoverflow.com/questions/29178135/bash-warning-argument-expected
Bash Shell: Check File Exists or Not
http://www.cyberciti.biz/faq/unix-linux-test-existence-of-file-in-bash/
HowTo Format Date For Display or Use In a Shell Script
http://www.cyberciti.biz/faq/linux-unix-formatting-dates-for-display/
Bash For Loop Examples
http://www.cyberciti.biz/faq/bash-for-loop/
Check existence of input argument in a Bash shell script
. Any arguments appear as "$1"
, "$2"
, "$3"
and so on. The count of arguments is in the shell variable "$#"
.
http://stackoverflow.com/questions/6482377/check-existence-of-input-argument-in-a-bash-shell-script
How to use shell variables in awk script
$ awk 'BEGIN{print "'$v'"}'
$ 123test
variable="line one\nline two"
awk -v var="$variable" 'BEGIN {print var}'
line one
line two
http://stackoverflow.com/questions/19075671/how-to-use-shell-variables-in-awk-script
shell sleep
http://www.cyberciti.biz/faq/linux-unix-sleep-bash-scripting/
- s for seconds (the default)
- m for minutes.
- h for hours.
- d for days.
To sleep for 5 seconds, use:sleep 5
To sleep for 2 minutes, use:sleep 2m
To sleep for 3 hours, use:sleep 3h
To sleep for 5 days, use:sleep 5d
Oracle shell
https://oracle-base.com/articles/misc/oracle-shell-scripting
大胡子爷爷是如何从shell 脚本里面将数据传到sqlplus 里面
#!/bin/ksh
$min_snap=421
export $min_snap
$max_snap=426
export $max_snap
$ORACLE_HOME/bin/sqlplus -S perfstat/perf$ORACLE_SID@$ORACLE_SID @sppurge $min_snap $max_snap
$ORACLE_HOME/bin/sqlplus -S perfstat/perf$ORACLE_SID@$ORACLE_SID @sppurge $min_snap $max_snap
http://www.dba-oracle.com/t_passing_sqlplus_variable_in_shell_script.htm
来源:oschina
链接:https://my.oschina.net/u/2308739/blog/758141