modifying a file without and editor
Hi.
I am wanting to find a way to modify a file, for instance (vfstab)'example only' lets say I have an entry(line) in there that I need to '#' out, but are un able to vi or us any other editor on the file I seen people change the line of a file by using a string command. not sure if it was a cat/sed/echo.... For the life of me I can not remember how they did it. thanks |
hashing out a line cannot be done through cat or echo. using echo you could append a line. you could do it by sed but that would be complex.
vi is always there and if you can use cat you can also use vi. |
sed would be the easiest solution.
|
mdhmi, could you give me a command using sed to hash out 10th line out of a 17line file. :)
eg Quote:
|
Code:
sed 10d file |
not delete the line, insert a hash.
|
Code:
sed '10 s/^/#/' |
All times are GMT -5. The time now is 06:41 AM. |