input data

Bash Shell Read a Line Field By Field

by Vivek Gite on March 14, 2010 · 5 comments

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

{ 5 comments }

tsort: UNIX / Linux Perform Topological Sort

by Vivek Gite on December 9, 2008 · 1 comment

Q. How do I perform topological sort or topological ordering without writing code in C or other programming language? How do I performs a topological sort on the given FILE using a shell script?

{ 1 comment }

PHP: Verify And Sanitize Email Address

by Vivek Gite on September 19, 2008 · 6 comments

Q. How do I verify input data such as email address under PHP programming language?

{ 6 comments }

Apache Log POST Data To A Log File

by Vivek Gite on April 17, 2008 · 7 comments

How do I log POST data submitted by our user registration form to a log file under Debian Linux Apache 2 Web Server?

{ 7 comments }

Sed Delete Last Character

by Vivek Gite on July 14, 2007 · 5 comments

How do I delete a last character from input line under UNIX / Linux using sed tool? My sample scientific input data line is as follows and I’d like to get rid of last + character only:

379100.46+521870.11+363838.75+382869.59+

How do I used sed to delete last + character?

{ 5 comments }

Bash Read Comma Separated CVS File

by Vivek Gite on August 14, 2006 · 1 comment

How do I read comma separated CVS file under UNIX / Linux / BSD / Mac OS X bash script?

{ 1 comment }