Symbolic link with commands?
Is it possible to create a symbolic link that include commands for the program?
For instance, I do the following to start the program: ./script -somecommannd I would like to create a symbolic like that includes "-somecommand" Is this possible? or would I need to create a second script that executes that command, and link to that script? |
No, the symbolic link is just a representation of the path.
You could consider using an alias instead, eg: Code:
alias script1='./script -somecommand' |
To make a script you can take cat `which zcat` or cat `which gunzip` for instance. That's what can be used globally instead of aliases, but both methods are good.
|
Another solution is to have multiple symlinks (or hard links) to a single script and program it to behave differently depending on which name it is called with:
Code:
c@CW8:/tmp$ cat test.sh |
Another potential thing you could do also is make a scripts directory like ~/scripts/ and add it to the $PATH variable, if you make the scripts executable (with chmod).
I am not sure where ubuntu stores such a place where this can be added. In CentOS it can be done in ~/.bash_profile by modifying the line PATH=$PATH:$HOME/bin to PATH=$PATH:$HOME/bin:~/script |
All times are GMT -5. The time now is 05:09 PM. |