10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have created one function for KSH and was running well with one parameter input since I just had to use $1 to get the parameter.
Now I want to do loop for each parameter(actually filenames) . I have try to use do loop, but $i does not resolve to parameter instead it resolves to 1,... (5 Replies)
Discussion started by: mysocks
5 Replies
2. UNIX for Dummies Questions & Answers
Hi,
need help to pass an paremeter to for loop script
$cat tp.ksh
for i in `grep $1 | cut -d "/" -f 5 | cut -d" " -f2`
do
fgrep $i $1 | grep 'with value' | cut -d "|" -f 2
done
$tp.ksh test_data.plan_49989_2015-05-01-00-13-38.log
command doesnot return the values. (5 Replies)
Discussion started by: AAHinka
5 Replies
3. Shell Programming and Scripting
I wrote this script which works well when I manually input 55518622 and 1
but I need this script to be generic and loop over the following table
awk '$4>(55518622-500000) && $4<(55518622+500000)' chr1_GEN2bim | awk 'BEGIN {min=1000000000; max=0;}; {\
if($4<min && $4 != "") min = $4; if($4>max... (8 Replies)
Discussion started by: fat
8 Replies
4. Shell Programming and Scripting
hi, i'm finding to solve on the parameter:
for example:
directory Value 1
root@value 1 > pwd
/home/user/root/value 1
root@value 1 > pwd | sed 's/ /\\ /g'
/home/user/root/value\ 1
root@value 1 > test="$(pwd | sed 's/ /\\ /g')"
root@value 1 > echo "$test"
/home/user/root/value\ 1
... (4 Replies)
Discussion started by: gsflash80
4 Replies
5. Shell Programming and Scripting
my program is designed to take the first parameters as extension, then the rest of the parameters as files to be searched for and, if found, modified by the extension. If not found, it prints an error.
Everything is great until: ./chExt.sh 'com' 'king cobra.dat'
where $file splits up the two... (2 Replies)
Discussion started by: username652719
2 Replies
6. Shell Programming and Scripting
Hi, i have this script
setenv.sh
if
then
echo "is empty"
fi
echo "done"
The following is the result when i run the script from command without and with a dot and space operator
$ setenv.sh
is empty
done
$ . setenv.sh
sh: VAR_1: Parameter not set.
$
It's our standard to run... (5 Replies)
Discussion started by: ysrini
5 Replies
7. Shell Programming and Scripting
Hi,
Could you please tell me how nawk command works when there is a asterisk <*> or space with asterisk < *> or <* > in the parameter.
I am just trying to read line by line and fetch fourth parameter separated by delimiter (|).
But if there is a * or < *> or <* > in the fourth parameter it... (7 Replies)
Discussion started by: nram_krishna@ya
7 Replies
8. UNIX for Dummies Questions & Answers
Hello everyone,
My main objective is to search for text within a file, namely a block of text where each line ends with a backslash "\".
However, the block must begin with a keyword, like "loginstring".
Here is an example of a file that contains a block:
###############
loginstring \... (2 Replies)
Discussion started by: idlechatter
2 Replies
9. Shell Programming and Scripting
Hi,
I have one shell script which use two parameter however one of its parameter have space in between.
eg.
a.sh 20110114 b c d
here b c d is one parameter
I used 'b c d' but its not giving correct result.
Also i tried b\c\d but this one also didnt work.
Any help would be... (5 Replies)
Discussion started by: diehard
5 Replies
10. Shell Programming and Scripting
Say I have (in psuedocode)
For i=1 to 10
tar cvfb /... 5*i /junk(i)
end
What I mean is that I want each successive for loop to have the block size parameter be 5 times the current counter. This isn't my actual code, just a stupid example...So the question is how do I descrive that parameter... (2 Replies)
Discussion started by: jeriryan87
2 Replies