|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I run the following script a lot:
#!/bin/bash #push.sh rsync -vaz -rsh="ssh -l user" $1 $2:~ Is there a way that I can put push.sh in my path and run it by simply typing: push option1 option2 ? Any help is greatly appreciated. |
|
#2
|
||||
|
||||
|
Yes. It is simply a matter of setting your PATH variable for your shell to include the path to your utilties. I usually put my custom stuff in $HOME/bin directory and add that to my path. Depending on your shell, the syntax to do this may vary.
bash shell: Edit $HOME/.bashrc and add export PATH=$PATH:$HOME/bin tcsh shell: Edit $HOME/.cshrc and add setenv PATH $PATH:$HOME/bin
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by Keath and KevinADC, superior perl programmers of the month Looking for a perl job with kick-*** programmers in a well-known NASDAQ listed tech company with branches in the US and Europe? We're hiring. PM me for details. Requirements |
|
#3
|
|||
|
|||
|
You can also use an alias, depending on the shell (C and Korn)
Code:
alias push="/path/to/push" |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Creating a command |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|