10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I only want the file copied if it is newer. But it still copies the file?
zip -u Ubuntu_Documents.zip ./*
cp -u Ubuntu_Documents.zip $DOCS_Backup/Ubuntu_Documents_`date +"%Y-%m-%d-%H-%M"`.zip (5 Replies)
Discussion started by: drew77
5 Replies
2. Shell Programming and Scripting
Hello Forum.
I have a file called abc.sed with the following commands;
s/1/one/g
s/2/two/g
...
I also have a second file called abc.dat and would like to substitute all occurrences of "1 with one", "2 with two", etc and create a new file called abc_new.dat
sed -f abc.sed abc.dat >... (10 Replies)
Discussion started by: pchang
10 Replies
3. UNIX for Dummies Questions & Answers
Dear All,
I'm new to unix scripting. I'm trying to write an utility script which has to check if one file is newer than another one. $3 $4 $5 $6 are files .txt. Help me please.
for i in $3 $4 $5 $6
do
if
then
echo "$1 is newer than $i"
else
echo "$i is newer than $1"
fi (9 Replies)
Discussion started by: Manueldo
9 Replies
4. Shell Programming and Scripting
Hi Folks,
I have an html file which contains the below line in the body tagI am trying the replace hello with Hello Giridhar programatically.
<body>
<P><STRONG><FONT face="comic sans ms,cursive,sans-serif"><EM>Hello</EM></FONT></STRONG></P>
</body>
I have written the below code to... (3 Replies)
Discussion started by: giridhar276
3 Replies
5. Shell Programming and Scripting
Hi All,
Need help on this
I have 2 files
one file file1 which has several entries as :
define service{
hostgroup_name !host1,!host5,!host6,.*
service_description check_nrpe
}
define service{
hostgroup_name !host2,!host4,!host6,.*
service_description check_opt
}
another... (2 Replies)
Discussion started by: namitai
2 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
I wanted to do following.
1) If file exit then open file for reading and check if my string is there then
i wanted to replace the entire line with that string + something else
then close the file.
2) If file does not exit then i need to open the file and write to it.
I am done with... (0 Replies)
Discussion started by: Tarun24
0 Replies
7. Shell Programming and Scripting
This should be a simple script, but can't find one with google search.
I just need to find the file that is in many directories, then overwrite that file with a newer version i.e.
find file.jar then overwrite with /root/file.jar
All I get in searches is substitute text with new test inside... (1 Reply)
Discussion started by: haircat
1 Replies
8. Shell Programming and Scripting
Hi,
I have a file with the following contents and i want to replace that value in a file with some other value.
#file.txt
/local/Disk/data
n
192.168.55.98
52035
3
1
2
1
1
192.168.55.98
Here is my code. (2 Replies)
Discussion started by: vanitham
2 Replies
9. Shell Programming and Scripting
Hi,
I have a text file, foo.txt, it looks something like below. In the file there is a line that gives the date in the form of: Mon Jun 15 11:09:31 2008. I need to find which date is the newest and then store certain details of that list data to another file. So, in this sample text file, I... (6 Replies)
Discussion started by: boolean2222
6 Replies
10. Shell Programming and Scripting
Dear All,
I'm new to unix scripting. I'm trying to write an utility script which has to check if one file is newer than another one. The condition is I dont know the full name of the first file. I searched google and this forum for any such examples, but couldn't find any or may be I would have... (9 Replies)
Discussion started by: achilles5
9 Replies