On Oct 02 10:05:19, [email protected] wrote:
> I tried the suggestion of Crystal but sure
> launching in the end the prompt string change  command from shell make the 
> prompt string change happening. As I would tranform all in an rc script the 
> problem remains changing the prompt string from inside my test script..
> 
> thx both
> 
> #!/bin/sh
> p="wiz$PWD\$ "
> g=`cat /etc/mygate`
> 
> ping -q -L -c 1 -w 1 $g > .nettest.log 2>/dev/null
> r1=`cut -d r -f 4 -s .nettest.log`
> 
> if [ "$r1" -eq "et=-1"]; then

ping itself has an exit status

> export PS1="$p"
> echo 0
> else
> export PS1="ww-$p"
> echo 1
> fi
> 
> #echo '"done."
> 
> I'm launching it from the shell of my user. Evrything is fine, the network 
> status change get detected (beside network latency) but no prompt string 
> change happens.

Because that code is not running in your shell;
it is runing in the #!/bin/sh subshell, which is another process.

Reply via email to