Posted on November 2nd, 2008 by linux
Here is a simple example on how to display date/watch with simple bash command:
$ while true; do clear; date; sleep 1; done
Filed under: Administration, Bash, Commands, Linux, Scripting | No Comments »
Posted on October 19th, 2008 by linux
I always keep forgetting this bash syntax redirection. This is because of my short memory and also because I do not use it often. In many cases we need to remove a STDERR from the command output and keep only STDOUT. On the other hand there are times that we want to see STDERR and [...]
Filed under: Administration, Bash, Linux, Scripting | No Comments »
Posted on April 30th, 2008 by linux
Using a bash command “set” we can prevent bash redirection to overwrite existing files. If the file bash.txt exist this command will overwrite it:
ls > bash.txt
To prevent it we can run command:
set -C
to disable run command:
set +o noclobber
Example:
$ ls > bash.txt
$ set -C
$ ls > bash.txt
bash: bash.txt: cannot overwrite existing file
$ [...]
Filed under: Bash, Linux, Scripting | No Comments »