Skip to main content

Posts

Showing posts with the label shell

tee coprocess vs tee pipe in Korn shell

tee coprocess vs tee pipe in Korn shell I had this piece of code which logged the output of a while loop to a file but also showed it on the screen: while ... do ... done | tee logfile A code change required to set a variable in the while loop and make it known after the loop had ended so I tried while ... do x=123 ... done | tee logfile echo x=$x but x was empty since in a piped sequence the while loop is considered to be a sub shell and thus it cannot set variables in the parent process. There is a solution though in Korn shell using coprocesses . # Start a coprocess to log input to logfile via tee # and report it also to the current tty (tee logfile >/dev/tty) |& # Send output of while loop to coprocess while ... do x=123 ... done >&p echo x=$x will report x correctly. This works fine for my example where the script is run always in a terminal window. If the script is run in the background or via cron its (terminal) output needs to be captured, anything else...

TopIcons Plus GNOME Shell Extension

TopIcons Plus GNOME Shell Extension Do you want to move the GNOME Shell default hidden bottom-left system tray to the top-right on the top panel? If so, then TopIcons Plus extension by phocean is for you. This will make any of your tray application shows its icon always on the top panel. Install Follow our tutorial about installing GNOME Shell extension. Once installed, you will find a new entry in your GNOME Tweal Tool program and you will find any running tray application (such as Telegram, Hexchat, Shutter, or anything else) sits on the top panel. Default Tray Position This is the default GNOME Shell tray position on the bottom-left of the display. It is hidden by default and needs more clicks to show or to hide. We will change this. TopIcons Tray Position These are the same tray icons but on the top panel. By achieving this, every icon will never be hidden anymore. download  file  now