beginners bash scripts

30/04/2013

Bash Scripting useful Unix commands
Destructions of where to save a shell file to call it from a command line
did I mention I was a n00b at shell scripts 🙂
Advanced Bash-Scripting Guide
50 Linux Commands

And here’s my first simple script ‘alter’, saved in my /bin directory.
#!/bin/bash
FILENAME="$1"
sudo cp ${FILENAME} ${FILENAME}.old
gksudo gedit ${FILENAME}

From the CLI type: alter filename
a copy is then taken of the file, and named filename.old, and filename is opened up in an editor window 🙂