On Fri, Oct 02, 2026 at 07:33:50AM +0200, dan wrote:
>
> > 2. I'm EXTREMELY in search of a visual input
> > maybe a "ww" inserted somewhere in the
> > console prompt that say me if I'm
> > connected with *the main network
> > interface* I defined.
> >
>
> I just script the logic to change prompt string on the change of network
> status but after I do:
>
> export PS1='ww-etc$ '
>
> exactly like in .profile or typing at prompt I obtain no prompt string update.
>
> I wonder what I'm missing in my script ?
A lot.
Try this:
1. Save this script as $HOME/my_prompt and chmod to 755:
#!/bin/sh
[ "$(($RANDOM%2))" -eq 0 ] && echo ':-)' || echo ':-('
2. Now at the shell do:
$ export PS1='`$HOME/my_prompt`\$ '
Press enter a few times and you have a prompt that changes.
Replace the script above with the one that checks your network status or
whatever.