The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
running script in cron - with ssh commands - not working frustrated1 Shell Programming and Scripting 31 09-16-2008 11:14 AM
Modifying simple commands to create a script rocinante Shell Programming and Scripting 8 06-03-2007 10:35 PM
Need Help Running a simple script tony3101 Shell Programming and Scripting 2 01-21-2007 07:30 PM
Problem running plsql & unix commands in 1 script siog UNIX for Dummies Questions & Answers 5 10-05-2006 11:46 AM
running commands from script owijust Shell Programming and Scripting 2 01-09-2006 06:12 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-27-2009
knelson knelson is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 1
running a simple script file with multiple commands

I'm trying to run a script file with multiple commands that I would normally type into the command line. The commands are:

#!/bin/bash
diff Test1.o0 /usr3/ronelso4/Desktop/verificationKPC/Test1.o0 > differences2
diff Test1a.o0 /usr3/ronelso4/Desktop/verificationKPC/Test1a.o0 >> differences2
diff Test2.o0 /usr3/ronelso4/Desktop/verificationKPC/Test2.o0 >> differences2
diff Test2a.o0 /usr3/ronelso4/Desktop/verificationKPC/Test2a.o0 >> differences2

For some reason when I execute it all I get in the file are the last files differences not all of the files. What am I doing wrong?
  #2 (permalink)  
Old 02-27-2009
treesloth treesloth is offline
Registered User
  
 

Join Date: Oct 2008
Location: Orem, Utah
Posts: 73
Hope I'm not starting with the too-obvious, but are you sure that there actually *are* any differences in the first 3 diffs? And you're sure that the diffs that are in the file are from the last diff? You could output each diff to a different file, instead of to the same file, and see what happens. Other than that, nothing looks incorrect in what you're doing. You might try:
#!/bin/bash diff Test1.o0 /usr3/ronelso4/Desktop/verificationKPC/Test1.o0 > differences1 diff Test1a.o0 /usr3/ronelso4/Desktop/verificationKPC/Test1a.o0 > differences1a diff Test2.o0 /usr3/ronelso4/Desktop/verificationKPC/Test2.o0 > differences2 diff Test2a.o0 /usr3/ronelso4/Desktop/verificationKPC/Test2a.o0 > differences2a cat differences1 differences1a differences2 differences2a >> differences.all
-->
Code:
#!/bin/bash
diff Test1.o0 /usr3/ronelso4/Desktop/verificationKPC/Test1.o0 > differences1
diff Test1a.o0 /usr3/ronelso4/Desktop/verificationKPC/Test1a.o0 > differences1a
diff Test2.o0 /usr3/ronelso4/Desktop/verificationKPC/Test2.o0 > differences2
diff Test2a.o0 /usr3/ronelso4/Desktop/verificationKPC/Test2a.o0 > differences2a
cat differences1 differences1a differences2 differences2a >> differences.all
        
In theory. that *should* give exactly the same end result (except for the filename) as your setup. Does it?
Closed Thread

Bookmarks

Tags
basic, scripting

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:14 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0