Hi,
i am using a unix system and have made a .profile file to declare custom commands.
I did this by typing in that file functions like this:
where $1 can be set to true or false by calling this alias like this:
~user$: showAllFiles true
but now i want to be able to create commands with multiple parameters but i don't know how to do it, i would like something like the following:
i would like to be able to specify two different parameters for that command like this:
~user$: cpFileToHtdocs /from/path /to/other/path
/from/path => $1
/to/other/path => $2
if you know how to do that, i would be very pleased to hear about it,
Thank you very much
Regards
i am using a unix system and have made a .profile file to declare custom commands.
I did this by typing in that file functions like this:
Code:
showAllFiles(){
defaults write com.apple.finder AppleShowAllFiles $1
killall Finder
}
~user$: showAllFiles true
but now i want to be able to create commands with multiple parameters but i don't know how to do it, i would like something like the following:
Code:
cpFileToHtdocs(){
sudo cp -i /Users/user/Documents/Projects/applicationX/code/$1
/usr/local/apache2/htdocs/applicationX/$2
}
~user$: cpFileToHtdocs /from/path /to/other/path
/from/path => $1
/to/other/path => $2
if you know how to do that, i would be very pleased to hear about it,
Thank you very much
Regards
Comment