06-22-2005
Quick & very dirty solution
I don't have time to write the code for you but you could do the following:
When updating...
grep the file for the original value,
generate new value...
pipe the file through sed and insert new value using s/// substitution.
This in no way counters the issue of file locking and temporary re-writes (i.e. output of sed overwriting original input). You can get away with it on small files but I wouldn't risk it in a professional system.
Alternatively, use Perl and the "profile" handler header that acts just like Get Private Profile in Windows API.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
If I want to ftp files from machine to local pc. But the ip must change everytime :( (due to VPN), can I write a script to easiler (no need to update ip in script)?
user_name=aaa
password=bbb
cat ip.txt
#
# FTP the files
#
ftp -d -in 199.200.204.109 <<EOF
user $user_name... (2 Replies)
Discussion started by: happyv
2 Replies
2. Shell Programming and Scripting
Hi
I have log like this :
And i want the log become like this :
can somebody help me?? (5 Replies)
Discussion started by: justbow
5 Replies
3. Shell Programming and Scripting
Hi,
IŽd like to know how to program a shell script for know when a file changes and based on that make another tasks all this in real time.. Thanks (2 Replies)
Discussion started by: mrios7
2 Replies
4. Shell Programming and Scripting
Hi,
Requirement:-
Need to change pfile,so while executing script,it has to go to pfile location(ORACLE_HOME/dbs) and open init<SID>.ora file and change value db_name=<>.
If db_name=abcd,script will change the db_name=1234 likr that..
Please help to code this (1 Reply)
Discussion started by: Sanal
1 Replies
5. Shell Programming and Scripting
Hi to all,
Maybe someone could help me. I want to transform the structure of a xml file.
I have this input.xml:
<?xml version="1.0" encoding="utf-8"?>
<votings>
<file name="Reference 19762">
<case id="No. 3 Div. 870">
<j v="1">Peter</j>
<j v="1">Ely</j>
<j... (10 Replies)
Discussion started by: cgkmal
10 Replies
6. UNIX for Dummies Questions & Answers
Hi, I need to write a script that changes the name of the filename. Let's say my script is named change_filename and I want to use it on a file named test1.txt. After running the script I want the filename renamed to test1_fails.txt
e.g.
$ ls
test1.txt test2.txt test3.txt
$ ... (15 Replies)
Discussion started by: millsy5
15 Replies
7. Shell Programming and Scripting
hi,
I have a local.conf file which has the first line
TOPDIR = "/home/mvdev/workspace/boxer". I want to replace the value to
"/home/common/workspace/mirror". I tried the following perl command that is
perl -p -i -e 's/Path/path1/g' myfile.txt then
sed... (7 Replies)
Discussion started by: amvarma77
7 Replies
8. Shell Programming and Scripting
Hello all,
I have a line of code in a file that I need to change in the /etc/sysconfig/kdump file
presently the line reads:
KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off"
what I need to do is put a comment out the 1st line and repeat it, and... (5 Replies)
Discussion started by: gartie
5 Replies
9. Shell Programming and Scripting
I have a file that contains todays date(for ex- test_08/30/2013)
Now I want a script which will run and change the name of the file and put yesterday's date
(for ex- test_08/29/2013)
Please help.
---------- Post updated at 04:40 AM ---------- Previous update was at 04:31 AM ----------
I... (2 Replies)
Discussion started by: sv0081493
2 Replies
10. Shell Programming and Scripting
I have a landing directory on my unix (solaris) server, that receives the following files:
MLH4301I AAOT-hhslog.610.20150805.txt
MLH4301I AAOT-hhslog.611.20150805.txt
MLH4301I AAOT-hhslog.612.20150805.txt
MLH4301I AAOT-hhslog.613.20150805.txt
and I need to add to this files the number 10000... (6 Replies)
Discussion started by: fretagi
6 Replies