From: Matthias Morche <morche@sat1.de>
To: gnu-win32@cygnus.com
Cc: Kim Ollivier <kimo@iconz.co.nz>
Subject: Re: How to echo a string of more than 1024 chars in a bash script?
Date: Fri, 10 Jul 1998 16:03:00 -0000 [thread overview]
Message-ID: <35A608CA.6833B84@sat1.de> (raw)
In-Reply-To: <35A559FA.F543C1D2@iconz.co.nz>
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".
next prev parent reply other threads:[~1998-07-10 16:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-07-09 19:48 Kim Ollivier
1998-07-10 16:03 ` Matthias Morche [this message]
1998-07-11 4:23 Earnie Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=35A608CA.6833B84@sat1.de \
--to=morche@sat1.de \
--cc=gnu-win32@cygnus.com \
--cc=kimo@iconz.co.nz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).