Results 1 to 2 of 2
I am trying to write a script to move a file to another directory.
I need to be able to run the script like so.
sh scriptname filename
Example:
sh ...
- 01-22-2009 #1Just Joined!
- Join Date
- Jan 2009
- Posts
- 3
Script problem
I am trying to write a script to move a file to another directory.
I need to be able to run the script like so.
sh scriptname filename
Example:
sh script1 lights
I am having difficulty getting the file i entered (lights)to be stored as a useable name like filename to move the file.
- 01-22-2009 #2Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
Google > Bash Scripting
Positional parameters
Arguments passed to the script from the command line [1] : $0, $1, $2, $3 . . .
$0 is the name of the script itself, $1 is the first argument, $2 the second, $3 the third, and so forth.


Reply With Quote