Tag Archives: bash

Uses for ‘sed’

I’ve lost count of the number of times I’ve had to check how to remove extra spaces from the end of the lines, or convert between DOS and Unix style line feeds so I thought I’d better write down some … Continue reading

Posted in CentOS, Debian, Linux, Raspbian, RedHat, Ubuntu, Uncategorized | Tagged | Leave a comment

Script template

The following shell script doesn’t do anything interesting by itself but it is a very useful bit of boiler plate for parsing command line options.

Posted in Programming | Tagged | Leave a comment

Check remaining disk space

The following commands will check to see if you are running out of disk space and warn you when any partition has 20% or less free space.

Posted in Programming | Tagged | Leave a comment

Prompting for a Yes/No response (BASH)

Short bash function routine to prompt the user to enter Yes or No (which may be abbreviated to Y or N) in response to a prompt.

Posted in Programming | Tagged | Leave a comment

Display download progress

Occasionally I want to display a user-friendly progress bar when doing something in a script, usually downloading a file.

Posted in Linux | Tagged | Leave a comment