10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have the following script, and I want to assign the output ($10 and $5) from awk to N and L:
grdinfo data.grd | awk '{print $10,$5}'| read N L
output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Discussion started by: geomarine
8 Replies
2. Shell Programming and Scripting
I want to make a config file which contain all the paths.
i want to read the config file line by line and pass as an argument on my below function.
Replace all the path with reading config path line by line and pass in respective functions.
how can i achieve that?
Kindly guide.
... (6 Replies)
Discussion started by: sadique.manzar
6 Replies
3. Shell Programming and Scripting
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies
4. Shell Programming and Scripting
hi,
i have a text file which conatins some fields delimited by space. some fields contains * as entries.
cron_file.txt
0 * * * *
0 3 * * *
i want to read each line 1 by 1 and store each field in seperate variables n a shell script.
i am unable to read the field that contains a *. how... (3 Replies)
Discussion started by: Little
3 Replies
5. Shell Programming and Scripting
I have a shell script main.sh which inturn call the python script ofdm.py, I want to pass two variables from shell script to python script for its execution. How do i achieve this ?????
Eg:
main.sh
a=3 b=3;
c= a+b
exec python ofdm.py
ofdm.py
d=c+a
Thanks in Anticipation (4 Replies)
Discussion started by: shashi792
4 Replies
6. Shell Programming and Scripting
Dear All,
we have a command output which looks like :
Total 200 queues in 30000 Kbytes
and we're going to get "200" and "30000" for further process. currently, i'm using :
numA=echo $OUTPUT | awk '{print $2}'
numB=echo $OUTPUT | awk '{print $5}'
my question is : can I use just one... (4 Replies)
Discussion started by: tiger2000
4 Replies
7. Shell Programming and Scripting
ok, so, i want to do something like this where i store results of codings in a variable, but when i run it, it doesn' twork:
example
HOT=34
BOSS=`john=133
if ; then
ADDIT=`expr 8 + 6`
case $HOT in
34) expr 4 + 5 ;; esac
fi`
it seems shell scripts have a problem with having ``... (2 Replies)
Discussion started by: SkySmart
2 Replies
8. Shell Programming and Scripting
HI ,
Is there any way to return a value of variable from shell to perl script.
Code:
===
Perl file
my $diff1=system("sh diff.sh");
my $diff2=system("sh diff1.sh");
I need exit status of below commands
i.e 0 and 1 respectively.
Since in both the cases diff is working so system... (3 Replies)
Discussion started by: srkelect
3 Replies
9. Shell Programming and Scripting
Hey guys, seems I can't transfer the $ip into gawk in the following bash script, where the problem is?
#!/bin/bash
while read ip
do
gawk '$1~"$ip"' /tmp/source
done < /tmp/ip
++
cat /tmp/ip
192.16.1.1|192.168.1.2|192.168.1.3
10.1.1.1|10.1.1.2
10.8.1.0|10.8.1.1|10.8.1.2
--
cat... (11 Replies)
Discussion started by: fedora
11 Replies
10. UNIX for Dummies Questions & Answers
Hi ,
i am beginner to Unix, I have one small script which execute java programme,it has java command input output structure . Right now i have given Input output structure manually that is on same directory, now how can i pass that by commandline
#!/bin/sh
java Classjava input.txt... (5 Replies)
Discussion started by: sam70
5 Replies