Pages

14/03/2010

Bash Shell Read a Line Field By Field

Bash Shell Read a Line Field By Field: "

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

Answer to 'Bash Shell Read a Line Field By Field'


Copyright © nixCraft. All Rights Reserved.

"