zsh_notes
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
zsh_notes [2023/01/03 20:57] – created raju | zsh_notes [2023/01/26 21:27] (current) – raju | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Sample scripts ===== | ||
+ | |||
+ | ==== backup a directory ==== | ||
+ | The idea here is to cd into a given directory and then backup a directory in it. The path names are hard coded to make things simple. | ||
+ | < | ||
+ | #! / | ||
+ | set -e | ||
+ | topdir=/ | ||
+ | bdir=projects | ||
+ | |||
+ | cd ${topdir} | ||
+ | |||
+ | asof=`date +' | ||
+ | ofile=${bdir}_${asof}.txz | ||
+ | tar cJf ${ofile} ${bdir} | ||
+ | if [ $? -eq 0 ]; then | ||
+ | printf " | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | Sample run: | ||
+ | < | ||
+ | % ~/ | ||
+ | backup stored in: / | ||
+ | </ | ||
+ | |||
===== To be sorted ===== | ===== To be sorted ===== | ||
- | ==== Change the default shell ==== | ||
- | * [[Change the default shell]] | ||
zsh_notes.1672779462.txt.gz · Last modified: 2023/01/03 20:57 by raju