Search Results

Search: Posts Made By: sjday
11,315
Posted By sjday
try this
you need to look at the system variable $PIPESTATUS

echo "Running program output"
myLine="./add 1 11"
`expr "$myLine"`| tee outputfile
echo "Succ/Fail : $PIPESTATUS"
7,713
Posted By sjday
this code worked for me
df -k |tail -n +2| awk '{if($4~/100|9[0-9]%/)print $NF" is out or running out of space ****"; else print $NF" has enough space"}'

if this doesn't work for you can you send a df -k output from your...
1,930
Posted By sjday
Possible solution
Create a awk file called neatcols with the following contents

{
printf "%-20s %s\n", \
$1, substr($0, index($0,$2))
}

then run it in

awk -f neatcols file3 > file4
3
14,570
Posted By sjday
another option
ls |xargs -i ls -l {}|grep -v total
2,135
Posted By sjday
thanks that worked a treat
thanks that worked a treat
2,135
Posted By sjday
Multiple variables from one command
I have the following bit of code

FOUND_SEC=`ls -ld $NAME 2>/dev/null|awk '{print $1}'`
FOUND_USER_NAME=`ls -ld $NAME 2>/dev/null|awk '{print $3}'`
FOUND_GROUP=`ls -ld $NAME...
2,254
Posted By sjday
My final solution
Just in case anyone is interested here is my final code that worked as I was expecting it

LINE_INFO=`echo $STATUS|awk 'match($0,"Line information: \".\*\" ") {print substr($0,RSTART,...
2,254
Posted By sjday
my current code
That didn't give me the results I was after. Heres a copy of something that appears to work but I am sure it could be done better

echo 'LINECMD> Line ////AT_VLD is UP. Line information:...
2,254
Posted By sjday
Searching and extracting text from output
I have the following output which I need to obtain the values for "Next Seq is xxx" and "Last Seq is xxx" and "Pending count is xxx". You will notice that the number of words prior to that value can...
Showing results 1 to 9 of 9

 
All times are GMT -4. The time now is 07:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy