[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getopts strange behaviour (Fedora)
From: |
Chet Ramey |
Subject: |
Re: getopts strange behaviour (Fedora) |
Date: |
Tue, 28 Jun 2005 11:33:15 -0400 |
User-agent: |
Mozilla Thunderbird 1.0.2 (Macintosh/20050317) |
cs@nightwish.eu.org wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: i386
> OS: linux-gnu
> Compiler: i386-redhat-linux-gcc
> Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu'
> -DCONF_VENDOR='redhat' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib
> -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -march=i386 -mcpu=i686
> uname output: Linux FC1-zalmoxe 2.4.30 #1 SMP Tue May 3 15:29:16 EEST 2005
> i686 i686 i386 GNU/Linux
> Machine Type: i386-redhat-linux-gnu
>
> Bash Version: 2.05b
> Patch Level: 0
> Release Status: release
>
> Description:
>
> getopts builtin command problem when parameters lack
>
> Repeat-By:
>
> While trying to use getopts builtin bash command I encountered the
> following problem:
>
> Test script:
>
> #!/bin/sh (/bin/bash)
> getopts ":xy" X
> echo $X
Try quoting the "$X" so it won't match any single-character filenames
you might have in the current directory after getopts sets it to `?'.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live...Laugh...Love
Chet Ramey, ITS, CWRU chet@case.edu http://tiswww.tis.case.edu/~chet/