[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

bash script



hi,

i'm trying to write a simple bash script but with no success so far.
what this script basically does: it checks if my second isdn line is on
and if not it tries to connect it until well until its connected :) it
usually takes more than 2-3 times till the second line is connected.

ok here is the script:

while [ "isdnctrl status ippp1 | grep not" ]; do
    isdnctrl addlink ippp0
    sleep 10              # wait until negotiation is finished
done


isdnctrl status ippp1 either returns "ippp1 connected to xxxxxx" or
"ippp1 not connected". but the problem is that there is no condition in
[ "isdnctrl status ippp1 | grep not" ] and i found no way to put
conditions on shell outputs, only on files. so the script goes on and on
for ever. any help?

and another script:

i have a simple "lsof -n | grep lftp | ..." and the output is sth. like:

lftp      27818  root    6w   REG  9,0  7597656   20379  /DIR/FILE

now how do i can remove "lftp      27818  root    6w   REG  9,0  7597656
  20379" so that only /DIR/FILE is left? i tried awk but it somehow
didn't work.

thx,
 thomas



Reply to: