Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-Id: <199912301934.NAA19749@sunflower.com> From: "Doug Wyatt" To: Chris Marshall Date: Thu, 30 Dec 1999 13:38:38 -0600 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: B20: declare built-in doesn't work in scripts, work around Reply-to: dwyatt AT sunflower DOT com CC: cygwin AT sourceware DOT cygnus DOT com In-reply-to: <00D9FFC41AA5D211BA1200A0C992CE010564DD@NORCOM2> X-mailer: Pegasus Mail for Win32 (v3.12a) Try placing the following in the first line of the command file #!/bin/bash - assuming, of course that is the correct path to Bash. Regards, Doug Wyatt > I am using beta 20.0 under NT 4.0. > > Running the following script: > > declare -i count > count=0 > count=count+1 > count=count+1 > echo count is ${count} > > should produce the output: > > count is 2 > > but instead produces the output: > > declare: not found > count is count+1 > > If the above script is in the file "do_it" and I run it from the bash > command line by typing "./doit" I get the wrong output. > > If I run it with "source ./doit" it works correctly. > > A better work-around to use in general is "( source ./doit )" so that when > the "exit" command appears in the script you are executing, the bash command > shell doesn't disappear. > > Chris Marshall > > p.s. Here is the output of cygcheck -s -v -r for my machine: > Cygnus Win95/NT Configuration Diagnostics > Current System Time: Thu Dec 30 14:15:43 1999 > > WinNT Ver 4.0 build 1381 Service Pack 5 > > Path: /home/d/cygnus/CYGWIN~1/H-I586~1/bin > /WINNT/system32 > /WINNT > /Program Files/Exceed.nt > /home/d/devstudio/sharedide/bin/ide > /home/d/devstudio/sharedide/bin > /home/d/devstudio/vc/bin > /home/d/bc5/bin > /jdk1.2/bin > > SysDir: C:\WINNT\System32 > WinDir: C:\WINNT > > MAKE_MODE = `UNIX' > PWD = `/home/f/data analysis/1299/sniffer' > > !C: = `C:\' > CLASSPATH = `c:\my documents\programs\java\classes;.' > COMPUTERNAME = `CHRISM1' > COMSPEC = `C:\WINNT\system32\cmd.exe' > HOMEDRIVE = `C:' > HOMEPATH = `\' > HOSTNAME = `chrism1' > HOSTTYPE = `i586' > INCLUDE = > `d:\devstudio\vc\include;d:\devstudio\vc\atl\include;d:\devstudio\vc\mfc\inc > lude;%include%' > LIB = `d:\devstudio\vc\lib;d:\devstudio\vc\mfc\lib;%lib%' > LOGONSERVER = `\\NORCOM2' > MACHTYPE = `i586-pc-cygwin32' > MSDEVDIR = `D:\DevStudio\SharedIDE' > NUMBER_OF_PROCESSORS = `1' > NUTHENA = `C:\foresight' > OS2LIBPATH = `C:\WINNT\system32\os2\dll;' > OS = `Windows_NT' > OSTYPE = `cygwin32' > PATHEXT = `.COM;.EXE;.BAT;.CMD' > PROCESSOR_ARCHITECTURE = `x86' > PROCESSOR_IDENTIFIER = `x86 Family 6 Model 7 Stepping 2, GenuineIntel' > PROCESSOR_LEVEL = `6' > PROCESSOR_REVISION = `0702' > PROMPT = `$P$G' > SHELL = `/bin/sh' > SHLVL = `1' > SYSTEMDRIVE = `C:' > SYSTEMROOT = `C:\WINNT' > TEMP = `C:\TEMP' > TERM = `cygwin' > TMP = `C:\TEMP' > USERDOMAIN = `NORCOM.NET' > USERNAME = `chrism' > USERPROFILE = `C:\WINNT\Profiles\chrism' > WINDIR = `C:\WINNT' > _ = `/home/d/cygnus/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) = `f:' > unix = `/home/f' > fbinary = 0x00000000 > fsilent = 0x00000000 > HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01 > (default) = `d:' > unix = `/home/d' > fbinary = 0x00000000 > fsilent = 0x00000000 > HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02 > (default) = `C:' > unix = `/' > fbinary = 0x00000000 > fsilent = 0x00000001 > HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrd > er\Start Menu\&Programs\Cygnus Solutions > (default) = (unsupported type) > HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions > HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin B20 > HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin B20\B20.1 > 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 > HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro > HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro\i586-cygwin32 > HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus > Solutions\GNUPro\i586-cygwin32\i586-cygwin32 > HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus > Solutions\GNUPro\i586-cygwin32\i586-cygwin32\cygwin-B20.1 > (default) = `d:\cygnus\cygwin-b20' > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cygnu > s Cygwin B20 > (default) = `C:\WINNT\IsUninst.exe -fd:\cygnus\cygwin-b20\Uninst.isu' > DisplayName = `Cygwin B20' > > a:\ fd N/A N/A > c:\ hd NTFS 4016Mb 64% CP CS UN PA FC > d:\ hd NTFS 3498Mb 49% CP CS UN PA FC > e:\ cd N/A N/A > f:\ hd NTFS 12958Mb 42% CP CS UN PA FC > g:\ fd N/A N/A > h:\ net NTFS 4337Mb 58% CP CS UN PA FC > > C: / native text!=binary > d: /home/d native text!=binary > f: /home/f native text!=binary > > Found: d:\cygnus\CYGWIN~1\H-I586~1\bin\bash.exe > Found: d:\cygnus\CYGWIN~1\H-I586~1\bin\cat.exe > Found: d:\bc5\bin\cpp.exe > Found: d:\cygnus\CYGWIN~1\H-I586~1\bin\find.exe > Found: d:\cygnus\CYGWIN~1\H-I586~1\bin\gcc.exe > Found: d:\cygnus\CYGWIN~1\H-I586~1\bin\gdb.exe > Found: d:\cygnus\CYGWIN~1\H-I586~1\bin\ld.exe > Found: d:\cygnus\CYGWIN~1\H-I586~1\bin\ls.exe > Found: d:\cygnus\CYGWIN~1\H-I586~1\bin\make.exe > Found: d:\bc5\bin\make.exe > Warning: d:\cygnus\CYGWIN~1\H-I586~1\bin\make.exe hides d:\bc5\bin\make.exe > Found: d:\cygnus\CYGWIN~1\H-I586~1\bin\sh.exe > > 371k 1998/12/01 d:\cygnus\CYGWIN~1\H-I586~1\bin\cygtcl80.dll - os=4.0 > img=1.0 sys=4.0 > "cygtcl80.dll" v0.0 ts=1998/12/1 3:25 > 5k 1998/12/01 d:\cygnus\CYGWIN~1\H-I586~1\bin\cygtclpip80.dll - os=4.0 > img=1.0 sys=4.0 > 10k 1998/12/01 d:\cygnus\CYGWIN~1\H-I586~1\bin\cygtclreg80.dll - os=4.0 > img=1.0 sys=4.0 > "cygtclreg80.dll" v0.0 ts=1998/12/1 3:25 > 600k 1998/12/01 d:\cygnus\CYGWIN~1\H-I586~1\bin\cygtk80.dll - os=4.0 > img=1.0 sys=4.0 > "cygtk80.dll" v0.0 ts=1998/12/1 3:28 > 446k 1998/12/04 d:\cygnus\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 23:39 > > > -- > Want to unsubscribe from this list? > Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com