I'd be looking at the login shell initialization that is not executed in the 
script.

A quick and dirty is to stick "set", "alias", and "env"  commands in the script 
and compare the outputs to those from your login shell.

My guess is some sort of globbing or nonomatch issue.

---- Original message ----
>Date: Wed, 21 Sep 2011 13:03:45 -0400
>From: [email protected] (on behalf of Jerry Feldman 
><[email protected]>)
>Subject: [Discuss] Strange rm behavior  
>To: Boston Linux and Unix <[email protected]>
>
>
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>I have a directory that is mounted from a NAS server
>/mnts/workspaces/foobar/project
>
>In my script, the code is:
>RM=/bin/rm
>cd /mnts/workspaces/foobar
>count=3
>while [ -d project ] && [count -gt 0];do
>    sleep 5  # there may be a process using a file. Wait for it to
>cleanup and exit
>    $RM -rf project
>    let count=$count-1
>done
>
>rm returns 0. buf fails to remove a couple of subdirectories.
>However all other subdirectories are successfully removed.
>if I execute the command '/bin/rm -rf project ' by hand it works fine.
>
>Also, I'm sure that no other process that affects this process is
>running in my test case.
>
>- -- 
>Jerry Feldman <[email protected]>
>Boston Linux and Unix
>PGP key id:3BC1EB90
>PGP Key fingerprint: 49E2 C52A FC5A A31F 8D66  C0AF 7CEA 30FC 3BC1 EB90
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.4.11 (GNU/Linux)
>Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
>iQEVAwUBTnoY8HzqMPw7weuQAQJkxwf/QwrGaR5WCxaqEeROdgtLxuhaa32AfER/
>idYTq6YUnuNFZkNMfl5p1ZyESbuy3vB+19aTWxsos9D89hirrNDFcQ1PcCCCIxYC
>R2ifX5GM4rwVP8MywjagZ3MspuwSa5DGP/mx1NFRIfIT3S2W+zQh3v1y6wHWGnPt
>ndlOMw+gW9Ba7fYv3tgeqrj9GkV4W+iwofM2va5L9S/2QECtfrBufMqef0p+TUkN
>FFMBGCMK6Gn5xsFRU6ysoFRjpiN9iZQOmXLzcbM6ZPLg0fHdVe4xyqCdb5UB1fi1
>cU6kt/Qt3WrMck19bKCVvg1XY5zXANCV+rtoK5Fo1/htZkyR+03aqA==
>=oAeB
>-----END PGP SIGNATURE-----
>
>_______________________________________________
>Discuss mailing list
>[email protected]
>http://lists.blu.org/mailman/listinfo/discuss
_______________________________________________
Discuss mailing list
[email protected]
http://lists.blu.org/mailman/listinfo/discuss

Reply via email to