10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi.. i am running nawk scripts on solaris system to get records of file1 not in file2 and find duplicate records in a while with the following scripts -compare
nawk 'NR==FNR{a++;next;} !a {print"line"FNR $0}' file1 file2duplicate - nawk '{a++}END{for(i in a){if(a-1)print i,a}}' file1in the middle... (12 Replies)
Discussion started by: Abhiraj Singh
12 Replies
2. 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
3. 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
4. Shell Programming and Scripting
Hi
I am looking for a unix command or a small shell script which can takes one parameter and then searches for the passed in the parameter in any or all files under say /home/dev/
Can anyone please help me on this? (3 Replies)
Discussion started by: pankaj80
3 Replies
5. 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
6. Shell Programming and Scripting
I need to parse log files using nawk, but I'm not able to pass script input argument (date) to nawk, for example:
------------
#!/bin/ksh
read date
nawk -F, '{if($1==date) print $4" "$5}'
-------------
Is there a way to pass an argument to nawk from shell script.
Many thanks... (8 Replies)
Discussion started by: samer.odeh
8 Replies
7. 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
8. Shell Programming and Scripting
for cmdopts in $*;do
case $cmdopts in
-mode)
mode="$2";shift 2
;;
-server)
server="$2";shift 2
;;
-Id)
Id="$2";shift 2
;;
-passwd)
passwd="$2";shift 2
;;
-rmtDir)
rmtDir="$2";shift 2
;;
-lcDir)
... (9 Replies)
Discussion started by: pinnacle
9 Replies
9. Shell Programming and Scripting
i'm new to shell scripting and have a problem please help me
in the script i have a nawk block which has a variable count
nawk{
.
.
.
count=count+1
print count
}
now i want to access the value of the count variable outside the awk block,like..
s=`expr count / m`
(m is... (5 Replies)
Discussion started by: saniya
5 Replies
10. Shell Programming and Scripting
Say I write something like the following:
var1=1
var2=2
for int in 1 2
do
echo "\$var$int"
done
I want the output to be:
1
2
Instead I get something like:
$var1
$var2 (2 Replies)
Discussion started by: Awanka
2 Replies