Bash Shell Read a Line Field By Field
last updated in Categories BASH ShellHow 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