How do I split string based on delimiter into array under Bash shell?
I work for a small ISP and we are using Unix operating system with bash shell. I want to write a shell script to parse the csv file line by line. Then line must be parse again field by field. The sample input file is as follows:
example.com,username,groupname,homedir,md5password,permission,secondarygroup
I need to extract each of these example.com,username,groupname,homedir,md5password,permission,secondarygroup and passed to the different system utilities. How do I write a shell script to automate this task and use the bash shell parse a text file?
How do I read a text file using awk pattern scanning and text processing language under Linux / Unix like operating systems?
How do I read a file field-by-field under UNIX / Linux / BSD Bash shell? My sample input data file is as follows:
device1,deviceType,major,minor,permissions
device2,deviceType,major,minor,permissions
…
….
..
deviceN,deviceTypeN,major,minor,permissions
For each line I need to construct and execute a shell command as follows:
/path/to/deviceMaker --context=$1 -m $permissions $device2 $deviceType $major $minor
How do I use awk pattern scanning and processing language under bash scripts? Can you provide a few examples?
How do I read a file line by line using awk utility under Unix / Linux operating systems?