10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Below is my script that works fine and prints the desired output:
#!/bin/ksh
echo "$1" |
while IFS= read -r dirpath
do
echo "DIRR_PATH:$dirpath"
install_dir=$install_dir" "$dirpath
done
echo "Desired Output:$install_dir"
Output:
./loopissue.sh... (10 Replies)
Discussion started by: mohtashims
10 Replies
2. Shell Programming and Scripting
Hi All.
Attached are two files.
I ran a query and have the output as in the file with name "FILEWITHFOURRECORDS.txt "
I didn't want all the spaces between the columns so I squeezed the spaces with the "tr" command and also added a carriage return at the end of every line.
But in two... (3 Replies)
Discussion started by: sparks
3 Replies
3. Shell Programming and Scripting
Hi all,
I have below code through which trying to pick data from specific columns strating from a certain row.
#!/usr/bin/perl
#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
4 Replies
4. Shell Programming and Scripting
Hi,
I want to capture space as well from the argument
eg:
script.ksh -m "Message from xyz" -e "email@xyz.com"
script.ksh -m 'Message from xyz' -e 'email@xyz.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
9 Replies
5. UNIX for Dummies Questions & Answers
I am looking for a regular expression that uses sed to replace multiple spaces with single spaces on every line where it is not at the start of the line and not immediately before double slashes ('//') or between quotes (").
In its simplest form, it would look like this:
sed -e 's# # #g'... (4 Replies)
Discussion started by: figaro
4 Replies
6. Shell Programming and Scripting
Platform : RHEL 5.8
I want to end each line of this file with a single quote.
$ cat hello.txt
blueskies
minnie
mickey
gravity
snoopyAt VI editor's command mode, I have used the following command to replace the last character with a single quote.
~
~
~
:%s/$/'/gNow, the lines in the... (10 Replies)
Discussion started by: John K
10 Replies
7. Shell Programming and Scripting
Hi all,
Is there a way to perform the above, I am trying to strip out more than one space from a line, but keep the single space. See below output example.
My Name is test test2 test3 test4 test5
My Name is test test2 test3 test4 test5
Please note that the lines would contain... (7 Replies)
Discussion started by: eo29
7 Replies
8. Shell Programming and Scripting
Hi Gurus
I am trying to figure out (with not much success) how to pass two values to a single getopts argument ... for example
./script -a Tuesday sausagesThe $OPTARG variable seems to only get populated with the first argument. What im looking to do is to process the first argument (i.e.make... (6 Replies)
Discussion started by: rethink
6 Replies
9. 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
1 Replies
10. Shell Programming and Scripting
Hi there
I have a data file like so below
'A/1';'T100002';'T100002';'';'01/05/2004';'31/05/2004';'01/06/2004';'08/06/2004';'1.36';'16';'0.22';'0';'0';'1.58';'0';'0';'0';'0';'0';'0';'clientes\resumen\200405\resumen_T100002_T100002_1.pdf';'';'0001';'S';'20040501';'';'02';'0';'S';'N'... (3 Replies)
Discussion started by: rjsha1
3 Replies