bash
Bash script to view log and config file in different server and paths.
2010/03/09
I was working on a project, where I need to open file from different servers and different paths. I do it with the command: […] vim ftp://username@server/path/filename […] This is okay …
create SQL-statements from textfile with awk
2010/03/08
<td> <div class="text codecolorer"> $ $ awk \'{printf "select * from table where id = %c%s%c;\\n",39,$1,39; }\' inputfile.txt </div> </td> </tr> …
Bash histoy – common history in different terminals
2010/03/04
I have been looking to do this for sometime. The bash history is per session basis and the last session to quit overwrites the bash_history file and thus all other terminals started between the time …
Bash Sub Shells
2010/03/02
Taken from <a href="http://www.linuxjournal.com/content/bash-sub-shells" target="_blank">here. […] <span class=\"c\">#!/bin/bash</span> <span …
bash script with sql to get the number of records from multiple tables.
2010/02/10
Here is the bash script: […] #!/bin/sh names[1]=errorlog names[2]=amit1log names[3]=amit2log names[4]=amit3log names[5]=amit4log j=1 echo $1 for i in $( sqlplus amit/passwd@tns @get_count.sql …
Bash styling(themeing), the stylist way.
2010/02/04
For last couple of days, I have been looking for solutions to make stlying my bash easier. So, first a screenshot of the effort: <img class="size-full wp-image-703" title="bash …
grep -v with multiple patterns.
2010/01/25
$ sed '/test/{/error|critical|warning/d}' somefile If you wanted to do all in one command, you could go w/ sed instead […] <a href="http://www.commandlinefu.com"><img …
sed tutorial and help
2010/01/21
A very nice turorial and help <a href="http://sed.sourceforge.net/grabbag/tutorials/">here.
change the terminal title dynamically in X11
2010/01/09
I was actually looking for this for quite sometime. Some years back in my bashrc was the proper setting for setting the terminal title when I did a cd, and I had completely forgotten how to do it. So …
shell — one liner to selectively change case
2010/01/07
Today I had a hard time, I had a herculian task of converting the case of file to upper case. Well that’s not difficult :), I know. What made it difficult was the fact that not the whole …
Know when you will type :q in your term instead of vi(m), the alias will chewed you out.
2009/12/20
most simple solution is to alias :q like so: alias :q=`echo ”This is not vim”` but as someone suggested in commandlinefu, you can use tput to put some color and fun into this. …
Display a block of text with delineated by a start pattern and an end pattern
2009/12/18
Taken idea from commandlinefu.com The command will display a segment from the file from the start pattern to the end pattern. function viewsegment() { tail -n +`fgrep -n -m 1 “$1” $3 | …