-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 13-Aug-2002/17:10 +0200, cana rich <[EMAIL PROTECTED]> wrote:
>
>Hello,
>     I've writen a script like this :
>#!/usr/bsh
>file='ls -1 /home/directory/*'
>echo $file

Try this:

  file=`ls -1 /home/directory`

>Meanwhile, when there is nothing in this directory, the script is
>blocked.

Bash expands the asterisk '*' to a list of file names. When there are no
matching files, it returns an error. Leave off the asterisk and the shell
will list what it finds, instead of trying to match filenames against
the '*' pattern.

Also, use the backquote [`] not the single quote ['].

Tony
- -- 
Anthony E. Greene <mailto:[EMAIL PROTECTED]>
OpenPGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
AOL/Yahoo Chat: TonyG05      HomePage: <http://www.pobox.com/~agreene/>
Linux: the choice of a GNU Generation. <http://www.linux.org/>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Anthony E. Greene 0x6C94239D <[EMAIL PROTECTED]>

iD8DBQE9WTmypCpg3WyUI50RAsBeAKC7vaNkdZxNJklFDIXB4/jFTQYNLwCfQVvk
mIrhIJKPUiFaXOYWg+aUPzE=
=JsI7
-----END PGP SIGNATURE-----



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to