all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Korn Shell Script Strangeness
@ 2004-02-21 20:24 Tennis Smith
  2004-02-22 17:04 ` Kai Grossjohann
  0 siblings, 1 reply; 2+ messages in thread
From: Tennis Smith @ 2004-02-21 20:24 UTC (permalink / raw)


Hi,

I was editing a korn shell script and had to introduce into it a few
lines of code for "ed", the batch editor.

Here's the code:

    for file in qos_cgest147.sai;
      do
      echo $file
      ed $file <<EOF
1,\$s/0:0:0  2.3946/0:0:0  2.9825/g
w
EOF
    done


Unfortunately, Emacs did seem to recognise the code
("shell-script(ksh88)" mode)and set the font colors. But, it would not
indent the area (see above).

So, I'm wondering how to make that happen.  The "ed" code is the only
thing in the whole file that simply won't indent when I do an
"indent-region".  How can I make this conform to some sort of uniform
formatting?

Any ideas what may be happening?

TIA,
-Tennis

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

* Re: Korn Shell Script Strangeness
  2004-02-21 20:24 Korn Shell Script Strangeness Tennis Smith
@ 2004-02-22 17:04 ` Kai Grossjohann
  0 siblings, 0 replies; 2+ messages in thread
From: Kai Grossjohann @ 2004-02-22 17:04 UTC (permalink / raw)


tennis_smith@yahoo.com (Tennis Smith) writes:

> So, I'm wondering how to make that happen.  The "ed" code is the only
> thing in the whole file that simply won't indent when I do an
> "indent-region".  How can I make this conform to some sort of uniform
> formatting?

Imagine you do

    cat > /tmp/foo <<EOF
foo
bar
EOF

The cat line is indented because of a surrounding if, or something.
Further imagine you reindent and then Emacs changes this to

    cat > /tmp/foo <<EOF
    foo
    bar
    EOF

Then you'll see two things happening.  The first is that the file
contents of /tmp/foo have suddenly changed -- it contains eight spaces
more than it used to.

Secondly, it might happen that the shell script doesn't run at all
because the shell is looking for "EOF" at the beginning of a line.
But I'm not sure about this, and I'm too lazy to check at the moment.

I'm happy that Emacs does not indent the here documents.

Kai

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

end of thread, other threads:[~2004-02-22 17:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-21 20:24 Korn Shell Script Strangeness Tennis Smith
2004-02-22 17:04 ` Kai Grossjohann

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.