[Bash][function] Passing parameters to a bash function Posted by Computer Newbie on 晚上9:48 in bash script, Linux, Ubuntu / No comments #!/bin/sh foo 1 # this will fail because foo has not been declared yet. foo() { echo "Parameter #1 is $1" } foo 2 # this will work.Output : happy@happy-laptop:~/Desktop/test2$ sh test3.sh test3.sh: 3: foo: not found Parameter #1 is 2 Reference : Passing parameters to a bash function Share This: Facebook Twitter Google+ Stumble Digg 以電子郵件傳送這篇文章BlogThis!分享至 X分享至 Facebook Related Posts:[tool] How to install vagrant and use it [tool] How to install vagrant and use it 1. First install vagrant sudo apt-get install vagrant 2.Choose one box to use. vagrant box add Ubuntu120… Read More[Linux] Edit /etc/fstab wrong format can’t boot Press <F10> to show boot menu before booting into kernel. Enter Repair filesystem mode Type “mount -n -o remount /”, then vi /etc/fstab.… Read More[Openvpn] Authentication method by using script and password file 1. Build up openvpn server (ubuntu) & client (windows) 2. Client configuration file settings Client Part: client dev tun proto udp remote 111.2… Read More[Linux] Ubuntu crash by using gentoo to rescue 1. Load Gentoo iso into Option Drive of virtualbox 2. mount root file system tree mount /dev/sda1 /tmp 3. mount device into ubuntu filesystem … Read More[Gentoo] Create binary packages to quick install binary on systemBinary package folder /usr/portage/packages1. Creating binary packages Create binary packages of gcc quickpkg sys-devel/gcc Create binary package… Read More
0 意見:
張貼留言