Modifying a particular data in a line contained in File I have a file containing data: systemname/userid/password/comment
I want to modify the "password" using script. Something like this would do the trick: Code: sed '/userid/s/oldpasswd/newpasswd/' inputfile > tempfile
&& \
Writing data in a text file at particular line I need to write value of variable $version at a particular
line in a text file.
Try something like this: Code:
AWK Help- Writing Data into a File I need to maintain a AUDIT file in system for every incoming and outgoing file. For this I am trying to append a record by using the AWK every time the file arriving. I have used the code as below.
$1 and $2 are global variables from the previous line of code. The above one is waiting for some more input and I don't now how to close the command. At the end AUDITFILE is creating with no records. How to append the data into a file by using the AWK? You can use echo instead of awk
Usage of awk is either on the output of a command like
Or on a file like awk '{print $1 $2}' filename
Have a Unix Problem
Unix Books :-
Return to : - Unix System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|