This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Checking XCOPY Exit Value in Cygwin Bash


Igor Peshansky wrote:
Nope, you didn't have to. Something like

(cd "$2/.." && find "$2" -name "*.$1" | tar cfT - -) | tar xfC - "$3"

would do the job of "XCOPY /S" using POSIX means.

If you go POSIX, you can use the --keep-newer-files tar option.

Of course it didn't. Please read a good bash tutorial, or the "Special
Parameters" section of the bash manpage.
Hi Igor and Mark,
   Thank you very much for the quick reply.

I was initially using

tar -cf - `find "$source_dir" -name "*.$file_ext" -print` | ( cd "$dest_dir" && tar xBf - )

but it had a problem with path names with spaces. Obviously being not that good in bash scripting, I couldn't get over that issue. So that was why I decided to use the XCOPY command. I will use your method and see. Thanks again.

I made a silly mistake in my former email. I was actually checking $? (not $!) for the exit code, but it didn't work. But I saw in a later reply from Mark that it worked for him. I will check it again. Maybe I was doing something silly.

thanks again Regards
Shane



-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]