public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* How to echo a string of more than 1024 chars in a bash script?
@ 1998-07-09 19:48 Kim Ollivier
  1998-07-10 16:03 ` Matthias Morche
  0 siblings, 1 reply; 3+ messages in thread
From: Kim Ollivier @ 1998-07-09 19:48 UTC (permalink / raw)
  To: gnu-win32

I have a script that generates a header and standard script that now
fails
if I run it under NT4.0 and B19 Cynus bash shell. I think it used to
work,
but it certainly does in Solaris.
eg
# make a dummy script
... various variables and setup options
... dates etc
echo "
# comments
Date: $DATE
commands
lots more lines.... more than 1024 chars in total
" > scriptname

The resulting scriptname file is truncated. Sometimes bash core dumps.

Is this a bash limit, an environment setting, an echo command limit, or
what.
If it is a built-in limit, what simple shell scripting techniques get
around it?

--
Kim Ollivier  (Ollivier & Company Limited)  kimo@iconz.co.nz
55 Balmain Road, PO Box 34 861,Birkenhead, North Shore City, NZ
ph +64 9 418 2220 fax +64 9 480 2254 mob +64 25 593 769
Bus http://www.ollivier.webnz.co.nz Home http://www.iconz.co.nz/~kimo


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to echo a string of more than 1024 chars in a bash script?
  1998-07-09 19:48 How to echo a string of more than 1024 chars in a bash script? Kim Ollivier
@ 1998-07-10 16:03 ` Matthias Morche
  0 siblings, 0 replies; 3+ messages in thread
From: Matthias Morche @ 1998-07-10 16:03 UTC (permalink / raw)
  To: gnu-win32; +Cc: Kim Ollivier

Kim Ollivier schrieb:
> 
> I have a script that generates a header and standard script that now
> fails
> if I run it under NT4.0 and B19 Cynus bash shell. I think it used to
> work,
> but it certainly does in Solaris.
> eg
> # make a dummy script
> ... various variables and setup options
> ... dates etc
> echo "
> # comments
> Date: $DATE
> commands
> lots more lines.... more than 1024 chars in total
> " > scriptname
> 
> The resulting scriptname file is truncated. Sometimes bash core dumps.
> 
> Is this a bash limit, an environment setting, an echo command limit, or
> what.
> If it is a built-in limit, what simple shell scripting techniques get
> around it?
...
That is bad style! Try to use cat and a here-document instead:
cat << EOF > scriptname
# comments
DATE : $DATE
commands
...
EOF

I guess Your Environment Space is not large enough for such a long
command line - The command line and the environment variables use the
same space.
-- 
	Matthias Morche ( mailto:morche@sat1.de )
		SAT.1 ( http://www.sat1.de )

>>> Linux: the greatest adventure game since the invention of the PC <<<
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to echo a string of more than 1024 chars in a bash script?
@ 1998-07-11  4:23 Earnie Boyd
  0 siblings, 0 replies; 3+ messages in thread
From: Earnie Boyd @ 1998-07-11  4:23 UTC (permalink / raw)
  To: gnu-win32, Kim Ollivier

---Kim Ollivier <kimo@iconz.co.nz> wrote:
>
> I have a script that generates a header and standard script that now
> fails
> if I run it under NT4.0 and B19 Cynus bash shell. I think it used to
> work,
> but it certainly does in Solaris.
> eg
> # make a dummy script
> ... various variables and setup options
> ... dates etc
> echo "
> # comments
> Date: $DATE
> commands
> lots more lines.... more than 1024 chars in total
> " > scriptname
> 
> The resulting scriptname file is truncated. Sometimes bash core dumps.
> 
> Is this a bash limit, an environment setting, an echo command limit,
or
> what.
> If it is a built-in limit, what simple shell scripting techniques get
> around it?

Don't know about any limits but you could do:

cat << EOD > scriptname
#comments
commands
lots more lines
EOD

-        \\||//
---o0O0--Earnie--0O0o----
--earnie_boyd@yahoo.com--
------ooo0O--O0ooo-------

To fix the most serious cygwinb19 problems:
  Please, _READ_ the IMPORTANT UPGRADE NOTICE at the end of this note.
  Please, ensure that there is only _ONE_ cygwinb19.dll.
  Please, ensure that _ALL_ b18 binaries have been removed.

Please, research your question via the Searchable Mail Archives first.
http://www.cygnus.com/ml/gnu-win32          (Searchable Mail Archives)

Check out these great gnu-win32 related sites:
ftp://ftp.cygnus.com/pub/gnu-win32/latest/                  (ftp site)
http://www.cygnus.com/pubs/gnupro/                    (Comercial Page)
http://www.cygnus.com/misc/gnu-win32/                   (Project Page)
http://dvpraktikum.informatik.uni-koeln.de:3232/ 
                                            (Cygwin32 Porting Project)
http://www.lexa.ru/sos                               (Sergey Okhapkin)
ftp://www.lexa.ru/pub/domestic/sos/                (Sergey's ftp site)
http://www.fu.is.saga-u.ac.jp/~colin/gcc.html (Colin Peters - Mingw32)
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/    (Mumit Khan)
ftp://ftp.hksys.com/pub/mirrors/EGCS-Win32/   (Jeremy Bettis - mirror)
http://gnu-win32.paranoia.ru                   (Chuck Bogorad's ports)
http://www.downloadwizard.com/ak/gnu-win32/bash.html
                                        (GNU-Win32 Bash Configuration)
http://www.parallax.co.uk/~andyp/index_text.html  (Andy Piper - ports)
http://www.tiac.net/users/cgf     (Christopher Faylor - package ports)
http://aquarius.franken.de/docs/develop/gnuwin32/GNUWin32.txt
                                               (Package Porting Notes)
ftp://ftp.franken.de/pub/win32/develop/gnuwin32/cygwin32/ 
                                                       (German mirror)
http://www.dol.ru/users/valtul      (Valery Tulnikov - software ports)
ftp://ftp.cs.nyu.edu/pub/local/fox/cygwin32 (David fox - RPM packages)
http://www.itribe.net/virtunix/winhelp-man-pages/     (HTML Man Pages)
http://www.kedemel.demon.co.uk/                       (Darren's ports)

Help for Win32 Beginners: 
 http://www.relisoft.com
 http://www.program.com/resources/win32.html

DISCLAIMER: These links or links from these pages to other sites do
not constitute an endorsement of any entities, advertisers, products 
or services therein. I am not responsible for and do not control or 
monitor the content of these sites or the accuracy of information 
found therein.

-------------------- IMPORTANT UPGRADE NOTICE ------------------------
You should get the following to update your cygwinb19 package:

Sergey Okhapkin's coolview package which contains an updated 
cygwinb19.dll.  (Yes, even if you've already downloaded the b19.1 
update from the Cygnus Site).

Mumit Khan's compilation of EGCS for the cygwinb19.dll; especially if 
you're using the C++ compiler.  The current version of the compiler
that 
comes with the tools has lots of problems that have been fixed with 
the EGCS version.  This is a drop-in replacement for the GCC toolset.

URL's are listed above.
-----------------------------------------------------------------------

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-07-11  4:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-07-09 19:48 How to echo a string of more than 1024 chars in a bash script? Kim Ollivier
1998-07-10 16:03 ` Matthias Morche
1998-07-11  4:23 Earnie Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).