<quote who="Alister Waller">
> how do I check that a file with a particular extension exists in a directory
> in a shell script.
>
> eg:
>
> if [[ -e *.TXT ]] ; then
How about...
if [ ! -z $(/bin/ls -1 | grep -c .TXT$) ]; then echo pants; fi
- Jeff
--
She said she loved my mind, though by most accounts I had already lost
it.
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug
- [SLUG] if [[ -e *.TXT ]] ; then Alister Waller
- Re: [SLUG] if [[ -e *.TXT ]] ; then Jobst Schmalenbach
- RE: [SLUG] if [[ -e *.TXT ]] ; then Jeff Waugh
- RE: [SLUG] if [[ -e *.TXT ]] ; then Alister Waller
- Re: [SLUG] if [[ -e *.TXT ]] ; then Jeff Waugh
- Re: [SLUG] if [[ -e *.TXT ]] ; then Terry Collins
- Re: [SLUG] if [[ -e *.TXT ]] ; then Russell Davies
- Re: [SLUG] if [[ -e *.TXT ]] ; then Alister Waller
- Re: [SLUG] if [[ -e *.TXT ]] ; then Russell Davies
- Re: [SLUG] if [[ -e *.TXT ]] ; then Jeff Waugh
- Re: [SLUG] if [[ -e *.TXT ]] ; then Alister Waller
