I have a requirement where I need to process both options and parameters.
command line call
I am using the following peice of code but I am usure how I can loop through all my parameters user1, user2, ... Note at the minium there were
be at least "user1"
Can somebody provide and example.
Thanks to all who answer
---------- Post updated at 02:50 PM ---------- Previous update was at 11:29 AM ----------
My solutuon. Its not fancy but appears to work. Any elegant solutuons are more than welcome
Last edited by joeyg; 05-31-2013 at 04:07 PM..
Reason: code not icode... (jg just adjusted)
hi..
this is my question:
it is possible transfer parameters from my program written in C to a .ksh script?
how can i do it?
i have a program in C, what is called from a .ksh script, and i need what the C program returns some values (parameters)
please, help me - any idea
thanks
... (2 Replies)
Here is my post with a question about getopts. I am running korn shell on Solaris 5.8. I am trying to ensure that certain options require a parameter, which is easy enough. I have found that if multiple options are entered on the command line together, but the parameter for one of the options is... (1 Reply)
hi all,
i have a ksh script that takes up to 3 parameters -- only 2 of which are required. what's the simplest way to check if the user passed 2 or 3 parameters?
if 3 parameters are not null then
do this
elif 2 parameters are not null then
do this
else
echo "you need at least 2... (5 Replies)
I'm trying to strip any garbage that may be at the end of my text file and that part is working. The problem only seems to be with the really long lines in the file. When the head command is executed I am directing the output to a new file. The new file always get a null in the 4096 position but... (2 Replies)
Hi there.
Could someone explain how do i get the options separated from the arguments. My problem is that i have a lot of options and in all of those options i need to have the parameters available to use in that option and all the others. How can i take the arguments before i cycle throw the... (4 Replies)
I need to write a Shell Script to process a huge folder of nearly 20 levels.I have to process each and every file and check which files contain lines like select insert update
When I mean line it should take the line till I find a semicolon in that file. I should get a result like this
... (1 Reply)
I'm working on AIX 6, ksh shell. The parameters are some strings quotated by double quotation marks which from a file. They are quotated because there may be spaces in them.
Example:
"015607" "10" " " "A"I want to pass these parameters to a shell function by writing the following command:
... (4 Replies)
Hi All,
I am new to scripting. Could you please assist me .
Here is my requirement. I have written a script that has 2 option flags defined.
-l) calls some function with the arguments passed in front of -l
-r) calls second function with the arguments passed in front of -r
*) calls the... (7 Replies)
Hello All,
I'm running Debian on a ThinkPad X1/2G and all seems to be running well.
However, it's got a SSD that needs the trim command run at regular intervals.
I'm implementing this using cron and a shell script, as recommended.
The cron job entries are as follow:
0 * * * *... (8 Replies)