[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Here documents and CRLF



"Guido Flohr" <gufl0000@stud.uni-sb.de> writes:

|> Hi!
|> 
|> I have made the following test with my stone-old Toswin (the hash `#' and
|> the greater sign `>' are my shell prompts):
|> 
|> # UNIXMODE=/brUs
|> # export UNIXMODE
|> # cat >junk <<EOF
|> > foo
|> > bar
|> > baz
|> EOF
|> # vi junk
|> 
|> In the vi it turns out that despite of the `b' in UNIXMODE the file junk
|> contains carriage returns:
|> 
|> foo^M
|> bar^M
|> baz^M

Which is expected if your bash was started without UNIXMODE.  The temp
file for the here document was created by bash, and with CRLF, since
UNIXMODE wasn't set.  The cat command does not change this, since it runs
in UNIXMODE semantics.  The only way to fix that is to make UNIXMODE a
special variable for bash (which is easy).

Andreas.

-- 
Andreas Schwab                                      "And now for something
schwab@issan.cs.uni-dortmund.de                      completely different"
schwab@gnu.org