how to update a file in bash
hi guys. I have been looking for some example of how to update a file that is already exist in bash. so far i haven found any. I'm using parameter as my first start for the existent, copy file to a different directory. can you guys help me please, show me some example of anyway to update a file.
thanks ahead guys.. |
I'm not sure if I understood correctly your question. But if you wanna edit a file check the command sed.
|
@520Soul
Greetingz! This kindof depends on the contents of the file in question, and exactly what you want to change. For example, as goossen pointed out, sed can really help out. Sed One-Liners Explained, Part I Sed One-Liners Explained, Part II Sed One-Liners Explained, Part III There's also awk, cut, grep, and a slew of other commands. Again it all boils down to what you're trying to do to the file in question. (Some sample output would be nice, along with what you're trying to accomplish) |
sorry for bad description.
Quote:
for instant, a file1 have data A,b,c. now file1 is re-written. and you want to update it. i think update and replace is the same right? i'm not sure if the word update is the correct word. it is like the file is old and you want to replace the old file with new one. does it has to have the same file name? i don't think it matter right? |
Quote:
Try this, in the same sequence, to understand some file operations: Code:
#cal > myCal <ENTER> |
the obvious would be cp, mv, rm, ...
|
All times are GMT -5. The time now is 05:53 PM. |