using diff and appending


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers using diff and appending
# 1  
Old 05-29-2005
Question using diff and appending

Hi,

I have two files in an html folder I would like to compare using diff. However I would like to append those files to a text file that is two folders up in my directory. Every time I try to do this I lose my information. What is happening and what should I do?
# 2  
Old 05-29-2005
Is the file you are appending to a log file or is it that you want then changes to appened to a HTML file?

Can you show us what you are currently doing?
# 3  
Old 05-29-2005
Thank you for your interest

here is kind of what I am working on, but I know it is incorrect somehow

diff (compare oldpage1.html with newpage2.html) append to notes.txt

here is the code sort of

diff oldpage1.html newpage2.html >> notes.txt

I haven't tried the >> yet because I don't know if it will erase/disappear everything or not but this looks like the closest to working code. Thank you again for helping.
# 4  
Old 05-29-2005
The >> operator will append the output to your notes.txt file. Neither file will being impacted by the diff command. If you are worried about erasing the contents of the notes.txt file, then simplly redirect to a new file while you sort out your issues. The > operator will over write the existing file (if it exists) with the contents of the redirection, otherwise it will create a new file containing the contents of the redirection.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Diff 3 files, but diff only their 2nd column

Guys i have 3 files, but i want to compare and diff only the 2nd column path=`/home/whois/doms` for i in `cat domain.tx` do whois $i| sed -n '/Registry Registrant ID:/,/Registrant Email:/p' > $path/$i.registrant whois $i| sed -n '/Registry Admin ID:/,/Admin Email:/p' > $path/$i.admin... (10 Replies)
Discussion started by: kenshinhimura
10 Replies

2. Shell Programming and Scripting

serach diff filename in diff location using shell scripting

Hi, I am new to shell scripting. please help me to find out the solution. I need a script where we need to read the text file(consists of all file names) and get the file names one by one and append the date suffix for each file name as 'yyyymmdd' . Then search each file if exists... (1 Reply)
Discussion started by: Lucky123
1 Replies

3. Shell Programming and Scripting

.procmailrc and uudeview (put attachments from diff senders to diff folders)

Moderator, please, delete this topic (1 Reply)
Discussion started by: optik77
1 Replies

4. Shell Programming and Scripting

Appending value to variable

I have a Query! by using command cat >> file1 we can append data's to a already existing file, Similarly is it possible to append a data to a variable. Thanks in Advance!! (2 Replies)
Discussion started by: gwgreen1
2 Replies

5. Shell Programming and Scripting

Simulate SVN diff using plain diff

Hi, svn diff does not work very well with 2 local folders, so I am trying to do this diff using diff locally. since there's a bunch of meta files in an svn directory, I want to do a diff that excludes everything EXCEPT *.java files. there seems to be only an --exclude option, so I'm not sure... (3 Replies)
Discussion started by: ackbarr
3 Replies

6. Shell Programming and Scripting

Appending date

hi All, Searched forum but couldn't find a solution to this problem: How can I append a file with date in the ninth line? ie I want to insert a line with the current date and time in the ninth line. I tried this: date=`date` awk 'NR==9 {printf "'$date' \n"} {print $0}' abc.log below... (10 Replies)
Discussion started by: Sreejith_VK
10 Replies

7. Shell Programming and Scripting

appending with AWK

Hi all, I have two files called INPUT1 and INPUT2 and i am trying to append the values of INPUT1 to INPUT2 using AWK. The INPUT1 file will always has a single field and the INPUT2 file has 3 fields but both files will have same number of records always. Following is the format of the... (5 Replies)
Discussion started by: harris2107
5 Replies

8. Shell Programming and Scripting

appending

hi, a1.txt ------ xyz zxc xya xdf a2.txt ------ a1 a2 b1 b2 cat a1.txt >> a2.txt -->its appending at the end (6 Replies)
Discussion started by: mohan705
6 Replies

9. Shell Programming and Scripting

appending

i've been fiddling around with append and I know how to append a word into a file, but how would you go about appending a word to a filename? (5 Replies)
Discussion started by: codewarrior7
5 Replies

10. Shell Programming and Scripting

diff 2 files; output diff's to 3rd file

Hello, I want to compare two files. All records in file 2 that are not in file 1 should be output to file 3. For example: file 1 123 1234 123456 file 2 123 2345 23456 file 3 should have 2345 23456 I have looked at diff, bdiff, cmp, comm, diff3 without any luck! (2 Replies)
Discussion started by: blt123
2 Replies
Login or Register to Ask a Question