A quick overview of Bash shell syntax: JustLinux’s Bash Programming Cheat Sheet.
-
« Home
-
RSS Feeds
A quick overview of Bash shell syntax: JustLinux’s Bash Programming Cheat Sheet.
Use exec as below, for example:
exec < $PASSWORD_FILE
while read LINE; do
user=`echo $LINE | cut -d: -f1`
uid=`echo $LINE | cut -d: -f3`
pgroup=`echo $LINE | cut -d: -f4`
homedir=`echo $LINE | cut -d: -f6`
shell=`echo $LINE | cut -d: -f7`
gecos=`echo $LINE | cut -d: -f5`
cmd=”/usr/sbin/useradd [...]