msgbartop
Tips, notes, HOWTOs
msgbarbottom

15 Jan 09 How To Set The Window/XTerm Title

I find it useful to set the window title of my terminals for long running processes so I can see at a glace what is happening in the window or where in the process running in that window is at.  In scripts I will use the following:

echo "\033]0;Window for ${USER}\007"

Of course replace “Window for ${USER}” with whatever is appropriate for your use.

Tags: , , , ,

18 Dec 08 Remembering The Shell’s Special Variables

I can never seem to remember what all of these default parameter variables are.  I found this small shell script that prints them out when I forget.

#!/bin/sh -vx
#######################################################
# example_1.1 (c) R.H.Reepe 1996 March 28 Version 1.0 #
#######################################################
echo "Script name is            [$0]"
echo "First Parameter is                [$1]"
echo "Second Parameter is               [$2]"
echo "This Process ID is                [$$]"
echo "This Parameter Count is   [$#]"
echo "All Parameters            [$@]"
echo "The FLAGS are                     [$-]"

It produces output like this:

#!/bin/sh -vx
#######################################################
# example_1.1 (c) R.H.Reepe 1996 March 28 Version 1.0 #
#######################################################
echo "Script name is            [$0]"
+ echo 'Script name is            [/home/me/bin/shellhelp]'
Script name is            [/home/me/bin/shellhelp]
echo "First Parameter is                [$1]"
+ echo 'First Parameter is                []'
First Parameter is                []
echo "Second Parameter is               [$2]"
+ echo 'Second Parameter is               []'
Second Parameter is               []
echo "This Process ID is                [$$]"
+ echo 'This Process ID is                [15190]'
This Process ID is                [15190]
echo "This Parameter Count is   [$#]"
+ echo 'This Parameter Count is   [0]'
This Parameter Count is   [0]
echo "All Parameters            [$@]"
+ echo 'All Parameters            []'
All Parameters            []
echo "The FLAGS are                     [$-]"
+ echo 'The FLAGS are                     [hvxB]'
The FLAGS are                     [hvxB]

via Richard’s Unix Shell Scripting Universe

Tags: , , ,

SEO Powered by Platinum SEO from Techblissonline