Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: altair
I don't think I actually answered your question. :)

> I figured it out under fire...

That implies you could really -edit- a file using only /bin/sh and no other binaries.

All I can think is something like:

exec < file_to_be_edited
while read line; do
  (some shell magic with line)
  echo "$line" >>
new_file
done
or maybe instead of a single variable line, use a series of variables for each word parsed from the input on each line.... argggh. And you'd still have to use mv to rename it back, so that can't be right.

I'd love to know how; willin' to share?

58 posted on 09/12/2010 2:35:21 PM PDT by dayglored (Listen, strange women lying in ponds distributing swords is no basis for a system of government!)
[ Post Reply | Private Reply | To 54 | View Replies ]


To: dayglored
I'd love to know how; willin' to share?

You were right. Yes, you do need mv. I was typing in the answer, see the post above.

63 posted on 09/12/2010 3:14:54 PM PDT by altair (Violence is the last refuge of the incompetent - Salvor Hardin)
[ Post Reply | Private Reply | To 58 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson