ITeye博客

shell

共 6 篇文章

bash two tips:tab completion igore-case and auto-correct mistyped dir name

in .bashrc #tab auto-completion ignore -case bind 'set completion-ignore-case on' #automatically correct mistyped directory names on cd shopt -s cdspell

2014-10-08 14:42 · shell

A Shell Script to do shell scripting faster

http://unix-school.blogspot.in/2011/08/shell-script-to-do-shell-scripting.html $ cat workon #!/usr/bin/bash if [ ! -f $1 ]; then echo "#!/usr/bin/bash" > $1 fi while [ 1 ]; do vi $1 chmod 755 $1 ./$1 read dummy done in .vimrc map #2 :wq!^M

2012-05-08 23:44 · shell

ftp put

#!/bin/ksh if [ $# -lt 3 ] then echo Usage: $0 hostname directory filename echo Note: make sure the machine,login,password has been existed in ${HOME}/. netrc. For example: echo echo machine=zsups315 echo login=root echo password=mypassword exit 1 fi hostname=$1 #get file list file=`echo $* | awk '…

2012-02-28 22:02 · shell

ftp get

#!/bin/ksh if [ $# -lt 3 ] then echo Usage: $0 hostname directory filename echo Note: make sure the machine,login,password has existed in ${HOME}/.net rc. For example: echo echo machine=zsups315 echo login=root echo password=mypassword exit 1 fi hostname=$1 #get file list #file=`echo $* | awk '{ fo…

2012-02-28 22:01 · shell

find class in which jar

#!/bin/ksh #this script is used to find class in which jar file if [ "$#" -le "1" ]; then echo "Usage: $0 class_name jar_path_1 [jar_path2]...[jar_pathn]" exit 1 fi #class to be found CLASS=$1 shift 1 for JAR in $* do if [ -d ${JAR} ] then JARS=`find ${JAR} -name "*.jar"` else JARS=${JAR} fi FOUND=…

2012-02-28 21:57 · shell

linux command: dash as a operand

for exampe: mv -- -a.txt The -- delimit the option list. Later arguments, if any, are treated a operands even if they begin with - or --. This applies to all commands such as rm, cp, mv, ls, ln and so on: command -- 'file' command [ options] -- 'file' rm -- '--filename' rm -fr -- '-dirname' rmdir -…

2011-11-09 13:54 · Misc · shell