Tag Archives: bash

Bashism: Convert the case of a variable

Following on with more Bash version 4 Shell coding notes, here’s a way (as always with Bash, there’s so many ways to do anything) to ensure a variable is all lowercase characters (or all uppercase): a=Hello echo ${a,,} hello You … Continue reading

Posted in Network Presence, Rich | Tagged , | Comments Off on Bashism: Convert the case of a variable

Use sed to delete lines between text phrases

How to remove lines from stdin between and including the 2 lines as fields in a sed expression: sed “/textline1/,/textline2/d” This will delete from the input all lines between a line containing the text ‘textline1’ and ‘textline2’. If you have … Continue reading

Posted in Sales | Tagged , | Comments Off on Use sed to delete lines between text phrases

Some Bash-isms

Being a “code daily” type of open-source SysAdmin/Operations Manager, I’ll post here a ‘tricks & tips’ that I’ve found useful when using and programming in the Bash Shell. This one notes how to replace a Bash variable name with another … Continue reading

Posted in Network Presence, Rich | Tagged , | Comments Off on Some Bash-isms

Nagios Acknowledge shell script

Nagios is often used in an environment where using or accessing its CGI-based web interface to ‘acknowledge’ alerts may be difficult or impossible. I was in such a situation recently, where a Nagios was going to SMS me about an … Continue reading

Posted in Network Presence | Tagged , , | Comments Off on Nagios Acknowledge shell script