Search Results

Search: Posts Made By: Mr. Zer0
12,577
Posted By Scott
awk 'NR>=6' file (That's not really...
awk 'NR>=6' file


(That's not really "grepping", it's just printing lines 6 onwards)
3,285
Posted By ygemici
you can try this :) PL=`ping -c 10...
you can try this :)


PL=`ping -c 10 localhost|grep "% packet"|cut -d"%" -f1|awk '{print $6}'`
if [ $PL -gt 50 ]
then
echo `date` "-> DR server is unreachable $PL percent package loss"
fi...
3,285
Posted By zaxxon
&& will only check if the last exit code was...
&& will only check if the last exit code was true/0 and checking if redirecting to a ls to a file was successful is not helpful.
Afaik you can't implement a "else" conditions by this.

Example:
...
3,285
Posted By frans
You don't need to grep as the ping command...
You don't need to grep as the ping command returns an error status when target is unreachable.
ping localhost -n 2 && { drReachable=Alive; echo -e "$(date): \\t DR server is reachable" >>...
Showing results 1 to 4 of 4

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