Hi All,
How to read the following command line values for a in my shell script?
./test.sh -a file1 file2 file3
i know we can use getopt() but i am geting only first value(file1)..
Any help appreciated
-jujose
Hi All,
How to read the following command line values for a in my shell script?
./test.sh -a file1 file2 file3
i know we can use getopt() but i am geting only first value(file1)..
Any help appreciated
-jujose
The rest of the filenames are in $*
or use $1 and shift
to process them one at a time.
The rest of the filenames are in $*
or use $1 andshift
to process them one at a time.
$* means all the agrumnets after -a ??
if my requirment is like test.sh -a file1 file2 -c file3 file4
wht would be the solution?
The solution would be to read the manual page for getopt again to see if you can tell it that -a has two parameters for example.
If not, them I guess you're stuck with the old fashioned way of doing it all yourself.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.