电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

LinuxShell脚本编程实例VIP免费

LinuxShell脚本编程实例_第1页
1/6
LinuxShell脚本编程实例_第2页
2/6
LinuxShell脚本编程实例_第3页
3/6
#! /bin/sh echo "Current command is $0" echo "The first parameter is $1" echo "The second parameter is $2" echo "The third parameter is $3" echo "Total of parameters if $#" echo "Current PID is $$" #!/bin/bash times=0 until [ "$times" = 3 ]; do echo "I love linux." sleep 2 times=`expr $times + 1` done #!/bin/bash # menu shell script. samli 2004.4.19 until echo "List Directory..........1" echo "Change Directory........2" echo "Edit File...............3" echo "Remove File.............4" echo "Exit Menu...............5" read choice test $choice = 5 do case $choice in 1) ls;; 2) echo "enter target directory:" read dir cd $dir ;; 3) echo "enter file name:" read file vi $file ;; 4) echo "enter file name:" read file rm $file ;; 5) echo "Goodbye" ;; *) echo "illegal option, please input again." esac done #! /bin/sh var1="abcd efg" echo $var1 var2=1234 echo "The value of var2 is $var2" echo $HOME echo $PATH echo $PWD #! /bin/sh num=0 while [ $num -le 10 ] do num=`expr $num + 1` if [ $num -eq 5 ] then continue fi square=`expr $num \* $num` echo $square done #!/bin/bash # Gnu bash versions 2.x # The Party Program--Invitations to friends from the # "guest" file guestfile=./guests # ~/shell/guests if [[ ! -e "$guestfile" ]] then printf "${guestfile##*/} non-existent" exit 1 fi export PLACE="Sarotini's" (( Time=$(date +%H) + 1 )) set cheese crackers shrimp drinks "hot dogs" sandwiches for person in $(cat $guestfile) do if [[ $person = root ]] then continue else # Start of here document mail -v -s "Party" $person Hi ${person}! Please join me at $PLACE for a party! Meet me at $Time o'clock. I'll bring the ice cream. Would you please bring $1 and anything else you would like to eat? Let me kn...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

LinuxShell脚本编程实例

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部