Quote:
Originally Posted by Four
I have added to /bin a bash script which just opens a program. I don't know if this is a good way to do it, but I don't know where to put an alias for all users.
I just would like one of two questions to be answered based on this case: if alias is better then just makeing a bash script that runs the program answer question 1 else 2
1. Where should I put the alias so all users can just type the name of the program instead of the whole path to it
2. How may I "redirect" all arguments to the program executed in bash script
Thank you!
|
You don't need a script just to open a program.
Whenever you have an executable file you can put the pathname in the PATH system variable---or you can link to a directory that is already in PATH. ("echo $PATH" to see whats there)
Passing variables to the program must be written into the script. Here is a crude example:
script name is myscript
program which it will run it myprogram
call the script with "myscript (123)"
inside the script, call the program with "myprogram ($1)"
Now you have passed the value 123 thru the script and into myprogram.
Check a book or online guide for exact syntax.....