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 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
3. Shell Programming and Scripting
i have 1 file say
LogDirectory='/var/tmp/logs'
DataDirectory='/var/tmp/data'
DBUSER='scott'
now i want to access these variables in many files where
#!/bin/bash
${DBUSER} , ${DataDirectory}
are called how do i do that?
Video tutorial on how to use code tags in The UNIX and Linux... (2 Replies)
Discussion started by: Gl@)!aTor
2 Replies
4. Shell Programming and Scripting
I am using C Shell MKS Toolkit and I ran into a huge problem when setting up some environment variables.:confused:
The csh script that I have as my login script runs fine but very very slow.
When I add a directory to my PATH it seems to slow down shell startup and even slow down the commands. ... (0 Replies)
Discussion started by: vas28r13
0 Replies
5. Shell Programming and Scripting
how to use the filehandle stored in a variable without knowing its file association i.e. the filename
code
my $logFH = $connObj->get('logFH');
infoPrint("Variable is of type IO \n") if(UNIVERSAL::isa($logFH, 'IO'));
infoPrint("$logFH\n");
output
== INFO :: Variable is of type... (0 Replies)
Discussion started by: rrd1986
0 Replies
6. Shell Programming and Scripting
Hi,
I am trying to do the following thing
var='date'
$var
Above command substitutes date for and in turn runs the date command and i am getting the todays date value.
I am trying to do the same thing as following, but facing some problems,
unique_host_pro="sed -e ' /#/d'... (3 Replies)
Discussion started by: gvinayagam
3 Replies
7. 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
8. Shell Programming and Scripting
Hi!
I'm trying to figure out how to reuse an "old" variable in a new bourne shell.
Am i supposed to use the export function?
If i write:
NAME="Simon"
echo $NAME
it returns Simon, but if i start a new shell and write
echo $NAME
it can't be found of course. How do i solve this?
... (7 Replies)
Discussion started by: bib2006
7 Replies
9. Shell Programming and Scripting
#!/bin/sh
APP_ROOT_MODE1=/opt/app1.0
APP_ROOT_MODE2=/opt/app2.0
APP_ROOT=${APP_ROOT_${APP_MODE}}
# enviornment variable APP_MODE will be exported in the terminal where
# we run the applciation, its value is string - MODE1 or MODE2
# My intension is:
# when export APP_MODE=MODE1... (4 Replies)
Discussion started by: princelinux
4 Replies
10. UNIX for Dummies Questions & Answers
i use solaris 5.8 & sco release 5
please answer the 2 queries
1) how to know, in which shell are we in?
2) how to use the fc command in different shells?
replies as usual are greatly appreciated.
raguram R (4 Replies)
Discussion started by: raguramtgr
4 Replies