Passing Parameters to Bash Script
I want to copy a file to a particular location. The location remains the same but the file is always different. I have to type "cp image.jpg ~/bkg.jpg." I would like to just type somehing like "icopy image.jpg" (icopy.sh being the shell script.) With a batch file I would just use:
ECHO OFF CLS COPY %1 ~/bkg.jpg What takes the place of "%1" in bash programming? Ted. |
Have you googled for BASH script programming yet? There is lots of info on the web.
|
%1 = $1
|
To: michaelk,
Yes I have googled Bash programming, there is some in both of my Linux books also, but sometimes there is too much information. I spent an hour trying to find out then decided to ask here. I always wonder at people who ask if I have googled yet. This is, after all, a forum all about answering questions rather than avoiding them. When someone asks me a question, I answer it if I have the ability to do so, and pass it by if I don't. I am not flaming you; just trying to get you to think. To: mikshaw, Thank you very much for your succinct answer; I will put it to use immediately. Have a good day. Ted. |
All times are GMT -5. The time now is 02:28 PM. |