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. Programming
Hi again and thanks to R.Singh.
One more question here.
The code works in awk. (or GAWK)
awk 'BEGIN{print "Enter your Name: ";getline name < "-";print RS "Input entered by user is: "name}'
How to display the variable name again ?
The awk script is running automaticly to the... (3 Replies)
Discussion started by: Zabo
3 Replies
3. Shell Programming and Scripting
Hi Gurus,
I have a command to assign value based on input value.
current condition is "if pattern matches "case", then assign "HOLD" else "SUCC"right now, I need to add one more condition (variable name is VAR).
the condition is "if pattern1 matches "case", then assign "HOLD" else if... (2 Replies)
Discussion started by: ken6503
2 Replies
4. Shell Programming and Scripting
I've made a number of errors with this and am trying to work a solution within the same framework.
/bin/ksh
for host_name in ahost1 ahost2 bhost1 bhost2
do
for host_prefix in a b
do
if echo ${host_name} | grep -qi ${host_prefix}
then
if
... (1 Reply)
Discussion started by: squrcles
1 Replies
5. Shell Programming and Scripting
Simple enough problem I think, I just can't seem to get it right.
The below doesn't work as intended, it's just a function defined in a much larger script:
CheckValues() {
for field in \
Group_ID \
Group_Title \
Rule_ID \
Rule_Severity \
... (2 Replies)
Discussion started by: Vryali
2 Replies
6. UNIX for Advanced & Expert Users
Hi,
I want to parse nested variable in my script.
for exp-
c=1
G1='0318'
G2='0023'
G3='3092'
G4='0014'
while ;do
g=G$c
a=$g
echo "Group=$g and value=$a"
c=`expr $c + 1`
done
final output are as -
---------------------------
Group=G1 and... (4 Replies)
Discussion started by: apskaushik
4 Replies
7. 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
8. Shell Programming and Scripting
I have a question about nested double quotes. Any help is appreciated.
Here are my commands on Mac OS.
# string="Ethernet \"USB Ethernet\" \"Bluetooth DUN\" AirPort FireWire \"Bluetooth PAN\""
# echo $string
Ethernet "USB Ethernet" "Bluetooth DUN" AirPort FireWire "Bluetooth PAN"
#... (3 Replies)
Discussion started by: lindazhou
3 Replies
9. 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
10. Shell Programming and Scripting
Hi all,
I'm having problems with the setting a variable in a nested if statement. It doesn't seem to change even if it mets the 'if' condition.
My script essentially looks for a user name from the output from a kerberos command.
When I find the user name, I tried to change a variable and exit... (6 Replies)
Discussion started by: geass
6 Replies