TAG: scripting

PageDescriptionTags
Bash Mitigate typos and errors in your scripts # Tell bash that it should exit your script if any statement # returns a non true return value: set -e # This will exit your script if you try to use an uninitialized # variable: set -u Some useful bash shell constructs or one liners: ,
Perl one liners Simple replace How to edit a bunch of files with one simple command: perl -pi.bak -e 's/bad/good/' ~/files.*.conf Replaces occurence of 'bad' with 'good' in all matching files and creates a .bak copy of the modified files. Replace serial number in zone files: ,
Start & Stop Could be used as a template in /etc/init.d #! /bin/sh ### BEGIN INIT INFO # Provides: skeleton # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Example initscript # Description: This file should be used to construct scripts to be # placed in /etc/init.d. ### END INIT INFO # test -f "/etc/foo.conf" || exit 1 case "$1" in start) echo -n "… ,
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready