This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bash: Problems with pattern in conditional statements


Hi,

Maybe I am doing something really stupid, but I can't find the solution !!!.

If I try to use a conditional statement as

if [ ABC = A* ] 
then
   echo Ok
else
   echo Error
fi

the result is 'Error' when I expect ok!
I have also tried
if [ "ABC" = "A*" ] 


Can I use patterns into conditional statements?
If I'm not wrong, I can do such kind of things in ksh.

Thanks a lot,

Isi,

_______________________________________
Isidoro Legido Martínez
isleg@altavista.com
Penitentienenstraat 53
3000 Leuven (Belgium)
Tel. : + 32 16 231806
DNS : isleg.dyndns.org
_______________________________________________________________________

Free Unlimited Internet Access! Try it now! 
http://www.zdnet.com/downloads/altavista/index.html

_______________________________________________________________________


Cygnus Win95/NT Configuration Diagnostics
Current System Time: Sat Aug 19 00:01:29 2000

Win9X Ver 4.10 build 67766446  A 

Path:	/CYGWIN~1/H-I586~1/BIN
	/WINDOWS
	/WINDOWS/COMMAND

SysDir: C:\WINDOWS\SYSTEM
WinDir: C:\WINDOWS

MAKE_MODE = `UNIX'
PWD = `/bash'

!C: = `C:\CYGWIN~1'
BLASTER = `A220 I7 D1 H7 P330 T6'
CMDLINE = `bash'
COMSPEC = `C:\WINDOWS\COMMAND.COM'
CVSROOT = `:local:d:\src\master'
HOSTNAME = `isi'
HOSTTYPE = `i586'
MACHTYPE = `i586-pc-cygwin32'
OSTYPE = `cygwin32'
PROMPT = `$p$g'
SBPCI = `C:\SBPCI'
SHELL = `/bin/sh'
SHELLOPTS = `braceexpand:hashall:histexpand:monitor:history:interactive-comments:emacs'
SHLVL = `2'
TEMP = `C:\WINDOWS\TEMP'
TERM = `cygwin'
TMP = `C:\WINDOWS\TEMP'
WINBOOTDIR = `C:\WINDOWS'
WINDIR = `C:\WINDOWS'
_ = `/CYGWIN~1/H-I586~1/BIN/cygcheck'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\00
  (default) = `C:'
  unix = `/'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\00
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\03
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\04
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\05
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\06
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\07
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\08
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\09
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0A
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0B
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0C
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0D
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0E
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0F
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\10
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\11
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\12
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\13
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\14
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\15
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\16
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\17
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\18
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\19
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1A
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1B
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1C
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1D

a:\ fd           N/A    N/A                    
c:\ hd  FAT32   2497Mb  64% CP    UN           
d:\ hd  FAT32   7249Mb  11% CP    UN           
e:\ cd  CDFS     397Mb 100%       UN           Isi

C:    /        native  text!=binary

Found: C:\CYGWIN~1\H-I586~1\BIN\bash.exe
Found: C:\CYGWIN~1\H-I586~1\BIN\cat.exe
Not Found: cpp (good!)
Found: C:\CYGWIN~1\H-I586~1\BIN\find.exe
Found: C:\WINDOWS\COMMAND\find.exe
Warning: C:\CYGWIN~1\H-I586~1\BIN\find.exe hides C:\WINDOWS\COMMAND\find.exe
Not Found: gcc
Not Found: gdb
Not Found: ld
Found: C:\CYGWIN~1\H-I586~1\BIN\ls.exe
Not Found: make
Found: C:\CYGWIN~1\H-I586~1\BIN\sh.exe

  446k 1998/12/04 C:\CYGWIN~1\H-I586~1\BIN\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=1998/12/3 20:39
Use -h to see help about each section

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]