Brent
unread,May 10, 2010, 1:03:52 PM5/10/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to BisManLUG
Well, just like the good days when all there was available for editing
was a "line editor". Hmmm, may be that wasn't so great, but it
certainly did force one to learn regular expressions well. Does "ed"
or "ex" exist? "awk" could be used too.
If you only have the console available, copy the file to a usb thumb
drive and then make the edit on another system, then copy it back.
If you are accessing the system in some way through another system
(serial connection) you have a few other options available:
"cat" the file (hopefully it's not too big) to screen, copy it to your
clipboard, make the edit on a local system, then:
cat > newconffile
[paste content]
[enter]
[control-D]
This might give you a double spaced file. If so, you can also edit
the content locally as a "echo" shell script, paste that using the
file create method above, then have the shell script echo out content
and redirect that into your new file.
You could also write a while loop/readline shell script and do the
whole thing in script, but that is a little more painful.
Other things that come to mind would be using "split". You could
literally split the file into a bunch of little files, overwrite the
few lines/files with your new content and then "cat" the files back
together into a new file.
I suppose there are more ways, but hopefully this helps.