thompson@PAN.SSEC.HONEYWELL.COM (John Thompson) (04/02/91)
> I want to back up all the .ftn, .f, .c, and .h files in a directory tree > that is about 40 meg binaries and source. I did a tried this: > > wbak `find $SRC \( -name '*.[fch]' -o -name '*.ftn' \) ...` \ > -dev ct -f 1 > > This basic command came back with an 'argument list too long' error message > or something to that effect. It diddn't work. > > All I want is the .ftn, .f, .c, and .h files. I don't want the bin or .o > files. How can I do this? I want to put it into a weekly cron job if > not a daily. The problem is almost certainly that the resulting list of names is just too long. This can happen in Unix as well as Aegis, so I wouldn't start screaming about one flavor of the O/S or the other. Aegis programs will perform wildcard expansion _after_ invocation (unlike Unix, where each shell is responsible for expanding the argument list). Because of this, if you have Aegis loaded (even if you don't? Im not sure) you can easily do it by not expanding the wildcards with your 'find' command. You may need to escape or quote the meta-chars to avoid having your shell expand them, though. /usr/apollo/bin/wbak ?*.[fch] ?*.ftn -dev ct -f 1 is the base command. I lose track of the escape-char rules, but I imagine that you might need something along the lines of /usr/apollo/bin/wbak \?\*.\[fch\] \?\*.ftn -dev ct -f 1 in order to prevent cron or it's default shell from expanding them. -- jt -- John Thompson Honeywell, SSEC Plymouth, MN 55441 thompson@pan.ssec.honeywell.com Me? Represent Honeywell? You've GOT to be kidding!!!
nazgul@alphalpha.com (Kee Hinckley) (04/03/91)
In article <9104021508.AA11965@pan.ssec.honeywell.com> thompson@PAN.SSEC.HONEYWELL.COM (John Thompson) writes: > >> I want to back up all the .ftn, .f, .c, and .h files in a directory tree >> that is about 40 meg binaries and source. I did a tried this: >> >> wbak `find $SRC \( -name '*.[fch]' -o -name '*.ftn' \) ...` \ >> -dev ct -f 1 >> ... >expand them, though. > /usr/apollo/bin/wbak ?*.[fch] ?*.ftn -dev ct -f 1 >is the base command. I lose track of the escape-char rules, but I imagine >that you might need something along the lines of > /usr/apollo/bin/wbak \?\*.\[fch\] \?\*.ftn -dev ct -f 1 >in order to prevent cron or it's default shell from expanding them. Since you need recursive what you really want is /usr/apollo/bin/wbak $SRC/.../\?\*.\[fch\] $SRC/.../\?\*.ftn Single quotes would be easier, but then you probably want the variable expansion. I do wish Unix had a ... wildcard. You could dispense with 90% of the times when you use find. -- Alfalfa Software, Inc. | Poste: The EMail for Unix nazgul@alfalfa.com | Send Anything... Anywhere 617/646-7703 (voice/fax) | info@alfalfa.com I'm not sure which upsets me more: that people are so unwilling to accept responsibility for their own actions, or that they are so eager to regulate everyone else's.
dbfunk@ICAEN.UIOWA.EDU (David B Funk) (04/03/91)
In posting <9104021508.AA11965@pan.ssec.honeywell.com>, John Thompson writes: >> I want to back up all the .ftn, .f, .c, and .h files in a directory tree >> that is about 40 meg binaries and source. I did a tried this: >> >> wbak `find $SRC \( -name '*.[fch]' -o -name '*.ftn' \) ...` \ >> -dev ct -f 1 >> >> This basic command came back with an 'argument list too long' error message >> or something to that effect. It diddn't work. >> [ stuff deleted ] > >The problem is almost certainly that the resulting list of names is just too >long. This can happen in Unix as well as Aegis, so I wouldn't start screaming >about one flavor of the O/S or the other. > >Aegis programs will perform wildcard expansion _after_ invocation (unlike >Unix, where each shell is responsible for expanding the argument list). >Because of this, if you have Aegis loaded (even if you don't? Im not sure) >you can easily do it by not expanding the wildcards with your 'find' command. >You may need to escape or quote the meta-chars to avoid having your shell >expand them, though. > /usr/apollo/bin/wbak ?*.[fch] ?*.ftn -dev ct -f 1 >is the base command. I lose track of the escape-char rules, but I imagine >that you might need something along the lines of > /usr/apollo/bin/wbak \?\*.\[fch\] \?\*.ftn -dev ct -f 1 >in order to prevent cron or it's default shell from expanding them. John, your theory is right but your implementation missed one detail. There are _2_ versions of "wbak" shipped with Domain/OS. There is the file "/com/wbak" and the file "/usr/apollo/bin/wbak", they are _not_ the same program (almost but not quite). The "/com" version uses the traditional Aegis style wild card expansion via the "cl" library, the "/usr/apollo/bin" version has been 'Unixized' and has the "cl" wild card expansion turned off, so it depends upon the shell to do the wildcard expansion. This is to protect Unix users from choking if they try to back up a file that happens to contain an Aegis wildcard string (no surprises). So you would need to explicitly invoke "/com/wbak" from within a Unix shell if you wanted the power of the "cl" wildcard library to work for you. Thus your example would need to be: /com/wbak '?*.[fch]' '?*.ftn' -dev ct -f 1 Based upon the original poster's article, I think that he was looking for the tree walking capability of the '...' wildcard. So what he needed would be: /com/wbak '.../?*.[fch]' '.../?*.ftn' -dev ct -f 1 As far as I know, there are 3 such 'schitzoid' programs (seperate Aegis & Unix versions): prf, rwmt, and wbak. This is because of the need for the differences in wildcard handling. Dave Funk
rees@dabo.citi.umich.edu (Jim Rees) (04/04/91)
In article <1991Apr3.053404.6435@alphalpha.com>, nazgul@alphalpha.com (Kee Hinckley) writes: >> I want to back up all the .ftn, .f, .c, and .h files in a directory tree >> that is about 40 meg binaries and source. I did a tried this: >> >> wbak `find $SRC \( -name '*.[fch]' -o -name '*.ftn' \) ...` \ >> -dev ct -f 1 ... > /usr/apollo/bin/wbak \?\*.\[fch\] \?\*.ftn -dev ct -f 1 Since you need recursive what you really want is /usr/apollo/bin/wbak $SRC/.../\?\*.\[fch\] $SRC/.../\?\*.ftn If you would rather use Unix wildcard syntax, you can still use find: find $SRC \( -name '*.[fch]' -o -name '*.ftn' \) ... >file-list wbak '*' -dev ct -f 1 <file-list