Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Bash / Shell Scripting (http://www.programmingforums.org/forum26.html)
-   -   Parsing An External File (http://www.programmingforums.org/showthread.php?t=908)

joeljkp Oct 19th, 2004 7:58 PM

I'm trying to write a simple Bash script that performs some string and file operations, then runs an app on the result. This involves inserting a value into an existing external file.

So far, I've been doing this by echoing the first part of the file, then the variable, then the last part of the file, but this means that the file is internal to the script, instead of being an external entity.

I'm thinking that it'll be easier to just insert a $VARIABLE at the correct spot in the external file, then get Bash to parse it and replace this variable.

Any tips on how to do such a thing?

Thanks in advance.

ZenMasterJG Dec 12th, 2004 4:54 PM

I'm not sure how you're parsing the file in Bash, that sounds painful. If your just trying to find a field inside a text file, im sure writing an awk script to grab it out and then use it in the Bash script your writing.


All times are GMT -5. The time now is 4:39 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC