if you are very well aware of that Total_MB & Free_MB are 7th and 8th position in your output then try to store those values in a file let say space_details.txt and then execute below AWK.
then
try this out
Thanks for the answer, but the issue is that the script is to be used on multiple servers which have different versions of the asm commands. The output differs (column numbers) from one version to another...Hence why i was looking for a way to "find" the matching columns first, then do the queries...
---------- Post updated at 10:42 AM ---------- Previous update was at 10:40 AM ----------
Quote:
Originally Posted by in2nix4life
If the two fields positions are unknown, this awk expression may help. It'll step through the fields and when it finds the matching field prints out the number of that field:
Hope this helps.
Thanks, that may do the trick. I'll try it...
---------- Post updated at 12:47 PM ---------- Previous update was at 10:42 AM ----------
Quote:
Originally Posted by in2nix4life
If the two fields positions are unknown, this awk expression may help. It'll step through the fields and when it finds the matching field prints out the number of that field:
Hope this helps.
Hi.
Here is the script modified. I removed the loop as it is not necessary and tweaked your lines to reflect my needs...
I get a weird output though, that includes the "=" sign? (i did an echo just to see what was discovered through the awk)
output:
line 124 and 125 are "awk" lines...
---------- Post updated at 12:50 PM ---------- Previous update was at 12:47 PM ----------
UPDATE! Nevermind...
Just saw my error...
Treated the "awk" line as a variable to start with
sup experts..i had a script which was bugging me..was hoping someone could point out the issue here
Input file: space separated 2 columns
I wanted to print out the 2 columns after assigning them to variables ( bascially the same output but iterate through line by line ). The code worked... (7 Replies)
Hi,
I am trying to move a file from remote server to local server and when the transfer completes successfully i call a script in remote server to remove the file which was successfully transferred.
I do this by first getting the list of file in remote server and move the text file to local... (8 Replies)
Hi
I am not able to solve this minor issue even after a lot of trial! Will be thankful if you can help me out. This is part of a awk script and the loop is self-explanatory -
num_null_key=0 #for counting the number of null keys
num_non_null_key=0 #for counting the number of non null... (2 Replies)
Hi All,
I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command.
The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
limit.csv data
--------------
5600050 38Nhava
400077 27Bomay
rate.txt data
-------------
38NhaVA
27BomaY
27Bomay
below is my script:
for i in `cat limit.csv`
do
b=`awk '{print $1}' $i` (4 Replies)
Hi,
i=0
t5=6000001
while
do
i=`expr $i + 1`
t5=`expr $t5 + 1`
echo $t5
done
I am able to increment "col3" value but unable to get col1,col2 value.
Input:
t1=10001
t2=abc
t3=ghkc (5 Replies)
Greetings Experts,
I need to handle the views created over monthly retention tables
for which every new table in YYYYMMDD format, there is
equivalent view created and the older table which might be
dropped, the view over it has to be re-created over a dummy
table so that it doesn't fail.... (2 Replies)
Hi Team,
I have for loop in my shell script. Which basically loop through all files in the directory, When some files are in the directory it works just fine.
But if there are no files at all..still the for loop try to execute. Please help. Below is the code.
#!/bin/ksh
echo "Program... (5 Replies)
Hi
I am trying to parse a grep output using awk. It works fine individually and not working under the loop with variable name assigned.
cat > file.txt
dict=/dictr/abcd/d1/wq:/dictr/abcd/d2/wq:/dictr/abcd/d3/wq:
sample tried code
Nos=`grep -w "dict" file.txt | awk -F"=" '{print... (10 Replies)