LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-13-2004, 02:59 PM   #1
mikehlinuxquest
LQ Newbie
 
Registered: Sep 2004
Posts: 3

Rep: Reputation: 0
Help w/ batch/shell script


What is wrong w/ writing this script. It doesn't seem to work. Overwriting the previous file.

cp "/storage3/Smith/server/Users/vszabo/roy/Forecast/Budget vs Actual.xls" /storage3/Smith/JACCO/atchafalaya/
cp "/storage3/Smith/server/Users/vszabo/roy/Forecast/CapEx - Detail.xls" /storage3/Smith/JACCO/atchafalaya/
cp "/storage3/Smith/server/Users/vszabo/roy/Forecast/Forecast Cash Flow.xls" /storage3/Smith/JACCO/atchafalaya/
cp "/storage3/Dunhill/server/Users/vszabo/roy/Forecast/Forecast Income Stmt.xls" /storage3/Dunhill/JACCO/atchafalaya/
cp "/storage3/Dunhill/server/Users/vszabo/roy/Forecast/Forecast Support.xls" /storage3/Dunhill/JACCO/atchafalaya/
cp "/storage3/Dunhill/server/Users/vszabo/Pitch Book/Draft II.ppt" /storage3/Dunhill/JACCO/atchafalaya/
cp "/storage3/Dunhill/server/Users/vszabo/Misc/well schedule for insurance audit.xls" /storage3/Dunhill/JACCO/atchafalaya/
cp "/storage3/Dunhill/server/Users/vszabo/Fonda/Cash activity 9_1_03 through 11_30_03.xls" /storage3/Dunhill/JACCO/atchafalaya/
cp "/storage3/Dunhill/server/Users/vszabo/Fonda/Cash activity 9_1_03 through 11_30_031 II.xls" /storage3/Dunhill/JACCO/atchafalaya/
 
Old 09-13-2004, 03:05 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
What is wrong w/ writing this script. It doesn't seem to work. Overwriting the previous file.
Can you elaborate on that?
What is "the previous file", what's actually happening, and
what would you expect to happen?


Cheers,
Tink
 
Old 09-13-2004, 03:24 PM   #3
mikehlinuxquest
LQ Newbie
 
Registered: Sep 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Sorry...

I would expect each of the files to be copied to the new subdirectory, maintaining its current name. however, this isn't happening, it looks like the copy takes place, but no name is maintained so a "no name" file is continually being saved over itself with each copy (cp) command.

I'm trying to copy over a list of files that were returned from a grep search that I output to a text file, edited, and am trying to execute.
 
Old 09-13-2004, 03:46 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
What's the file-system on the target?

It works well here ...


Cheers,
Tink
 
Old 09-13-2004, 04:07 PM   #5
mikehlinuxquest
LQ Newbie
 
Registered: Sep 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Found it. Commands need to be treated as compound:

http://kristi.erdves.lt/books/Comput....html#Heading6


By adding a semi-colon at end of each line, execution works. (So far.)

Thanks for help.
 
Old 09-13-2004, 04:41 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Unless you're using a DOS based editor to create
the file there should be no need for ; ... a compound
is a command that has several command on ONE line,
which your example doesn't appear to have.



Cheers,
Tink
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
any shell script 2 batch file tools? rosbur Linux - General 12 11-27-2018 12:20 PM
Change batch script to shell script alan.belizario Programming 5 03-31-2005 12:41 AM
Change batch script to shell script alan.belizario Linux - Software 1 03-30-2005 01:49 AM
Java Shell / Batch Scripts GenericProdigy Programming 4 11-18-2004 09:00 AM
Batch mv and tr script ... OrangeWarp Linux - General 1 12-11-2002 05:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration