Hello Folks,
I have a file named as date.dat present at /tmp/abc location which has following data -
I need to remove this line and replace it with something like below -
Param1, Param2 and param3 stores the date based on some calculation in the same script.
Any leads will be greatly appreciated.
Moderator's Comments:
edit by bakunin: by now you could know that code and data go in CODE-tags, yes? Start using themselves instead of letting us edit your posts, please. Thank you
First off: what do you mean by "something like"? I am sure you look for a solution, not something like a solution, no? So, please, tell us what you need, not "something alike".
If i get you correctly you want to replace a line in a file with 3 selectable values, yes?
If so:
Save this to a file script.sh, flag it executable and call it with ./script.sh "param1" "param2" "param3".
Note that the script is a barebone solution - no effort is made for paramter checking, etc.. Add this functionality ad libitum.
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I am trying to automate hadoop installation procedure using shell script. It involves go to perticular directory... (3 Replies)
I am trying to automate hadoop installation procedure using shell script. It involves go to perticular directory and add some more lines to the file /etc/sysctl.conf. How this can be done?
Regards
Navaz (1 Reply)
Hi i have a file like this
mailboxnum 20
filename <to subsitute>
fileloaction /home/dd234/
filetype txt
in a directory i have set of files for ex:
TT45.1.2
TT45.1.3
TT45.1.4
.
.
in for loop i have to take this files and subsitute one by one
ex: (1 Reply)
i have a file called number which contains data as
1 2 3 4 5
6 7 8 9 0
9 8 7 6 5
4 3 2 1 0
0 1 2 3 4
needed a shell script to print the output as
1
7
7
1
4
and (2 Replies)
Hello,
I have a big file in wich I would like to rename inside this exactly the string '_ME' and not rename in case we have 'ABC_MELANGE'. Is there a way to do it by using a shell script?
Any tip will be apreciated.
The file is like described bellow, after using command more filename :
... (3 Replies)
Can anyone provide me a shell script to edit a xml file and delete one entry.
To do manually i can edit(vi editor) the file and 'dd' will delete the file.But I wiluld to know if I can do with a script.
Thanks in advance
Tannu (6 Replies)
I need to edit a config file using shell script. i.e., Search with the 'key' string and edit the 'value'.
For eg: below is what I have in the config file "configfile.cfg".
Key1=OldValue1
Key2=OldValue2
I want to search for "Key1" and change "OldValue1" to "NewValue1"
Thanks for your... (7 Replies)
Hi
I need some help using shell script to edit a file.
My original file has the following format:
/txt/email/myemail.txt
/txt/email/myemail2.txt
/pdf/email/myemail.pdf
/pdf/email/myemail2.pdf
/doc/email/myemail.doc
/doc/email/myemail2.doc
I need to read each line. If the path is... (3 Replies)
What I want to do is just delete some lines from a text file, I know it's easy using copy and redirect function, but what I have to do is edit this file (delete the lines) directly, as new lines may be added to the text file during this period. Can AIX do this ?
# cat text
1:line1
2:line2... (3 Replies)