[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:[Archlinux] How to compile the package of pacmanImportant paragraph: Pacman +---> Configuration file + +-> RootDir = The path which install the binary file … Read More[gnome-terminal] Error calling StartServiceByName for org.gnome.TerminalTry to regenerate locales first: # locale-gen And then: # localectl set-locale LANG=”en_US.UTF-8” And reboot. Reference: [SOLVED] Gnome terminal… Read More[Makefile][Tutor] Understand Makefile Makefiles The Makefile Makefile 語法簡介 Variables and Expressions Makefile Debugging: Tracing Macro Values Makefile範例教學 … Read More[WinSCP][Linux] Transmit file by using WinSCPDownload WinSCP Set account and password at WinSCP Reference: WinSCP Installing SFTP/SSH Server … Read More[Reinstall][Gentoo] Computer reinstall && quick install the tool script at Gentoogrep processor /proc/cpuinfo /etc/portage/make.conf MAKEOPTS=”-j4” Set USE="XXXX" --buildpkg # after compile the code will pick up the binary und… Read More
0 意見:
張貼留言