10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Below is my script that works fine and prints the desired output:
echo "$1" |
while IFS= read -r dirpath
echo "Desired Output:$install_dir"
./loopissue.sh... (10 Replies)
Discussion started by: mohtashims
I am working one one python script in version 3.x and 2.6. Need your support to complete it
Basically for both commands i have telnet to device and run command and then receiving input File 1 and File 2
I have two commands, need to grep data and output in csv file.
Next script/code... (0 Replies)
Discussion started by: as7951
3. UNIX for Beginners Questions & Answers
There are many places where I can see the syntax description for optargs, which, usually boils down to this:
getopts OPTSTRING VARNAME
OPTSTRING tells getopts which options to expect and where to expect arguments
VARNAME tells getopts which shell-variable to use for option reporting... (2 Replies)
Discussion started by: sharkura
4. Shell Programming and Scripting
I need help in understanding the default value for getopts option's argument in ksh. I've written a short test script:
printf "Usage: -v and -m are mandatory\n\n"
while getopts ":v#m:" opt; do
case $opt in
... (1 Reply)
Discussion started by: da1
5. Shell Programming and Scripting
I have below code through which trying to pick data from specific columns strating from a certain row.
#This script is to pick the specific fields from a files starting from a specific row
# FILE -> Name of the file to be pasd at runtime.
# rn -> Number of the... (4 Replies)
Discussion started by: Abhisrajput
6. Shell Programming and Scripting
I want to capture space as well from the argument
script.ksh -m "Message from xyz" -e "firstname.lastname@example.org"
script.ksh -m 'Message from xyz' -e 'email@example.com'
I am parsing using getopts, but for option "m" OPTARG is returning only "Message".
Please use code tags next time for... (9 Replies)
Discussion started by: tostay2003
7. Shell Programming and Scripting
Hi there, if i have a simple getopts like below ...how can i make it so that if somebody enters more than one -g argument for example, it will error with a " you cannot enter more than one -g" or something like that.?
I want to only allow one instance of a -g or a -h etc ..
while getopts... (1 Reply)
Discussion started by: hcclnoodles
8. Shell Programming and Scripting
I'm using bash and ksh93 compatible derivatives.
In a recent getopts experience, I found myself spending far too much
time on this little problem. I hope someone can help...
So here's the deal.
I want to build have a command line interface that accepts either zero,
one, or... (4 Replies)
Discussion started by: duderonomy
9. Shell Programming and Scripting
I am parsing command line options using getopts.
The problem is that mandatory argument options following ":" is taking next option as argument if it is not followed by any argument.
Below is the script:
while getopts :hd:t:s:l:p:f: opt
case "$opt" in
-h|-\?)... (2 Replies)
Discussion started by: gurukottur
10. Shell Programming and Scripting
I want to write a script which will check the arguments and if there is a single space(if 2 more more space in a row , then do not touch), replace it with _ and then gather the argument
so, program will be ran
./programname hi hello hi usa now hello hello
so, inside of program,... (7 Replies)
Discussion started by: convenientstore