ittechlab
asked on
sed - script
I am trying to understand these line. Can some one explain as i am new to scripting.
egrep 'PASS|FAIL' $LOGFILE | wc -l | sed 's/^ *//;s/ *$//'
grep PASS $LOGFILE | wc -l | sed 's/^ *//;s/ *$//'
grep FAIL $LOGFILE | wc -l | sed 's/^ *//;s/ *$//'
echo $SCAN_PASS/$SCAN_TOTAL*100 | bc -l | awk -F. '{print $1}'| sed 's/^ *//;s/ *$//'
egrep 'PASS|FAIL' $LOGFILE | wc -l | sed 's/^ *//;s/ *$//'
grep PASS $LOGFILE | wc -l | sed 's/^ *//;s/ *$//'
grep FAIL $LOGFILE | wc -l | sed 's/^ *//;s/ *$//'
echo $SCAN_PASS/$SCAN_TOTAL*100
This removes empty lines as well as lines containing only spaces.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
$SCAN_PASS=10
$SCAN_TOTAL=20
can you please advise what is this line does. do we need bc -l?
$SCAN_PASS/$SCAN_TOTAL*100 | bc -l | awk -F. '{print $1}'| sed 's/^ *//;s/ *$//'
$SCAN_PASS=10
$SCAN_TOTAL=20
can you please advise what is this line does. do we need bc -l?
$SCAN_PASS/$SCAN_TOTAL*100
ASKER
sorry.
SCAN_PASS=10
SCAN_TOTAL=20
not
$SCAN_PASS=10
$SCAN_TOTAL=20
SCAN_PASS=10
SCAN_TOTAL=20
not
$SCAN_PASS=10
$SCAN_TOTAL=20
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sed 's/^ *//;s/ *$//'