[kwlug-disc] Capturing output in scripts
Khalid Baheyeldin
kb at 2bits.com
Fri Aug 22 22:58:30 EDT 2014
On Thu, Aug 21, 2014 at 4:15 PM, Jonathan Poole <jpoole at digitaljedi.ca>
wrote:
> Have you set the filetype in vim?
> set ft=sh
>
> does the syntax highlighting work then?
>
It is set.
If I do "set:", I get (among other things):
syntax=sh filetype=sh
So, what matters is indeed set.
I noticed that the highlighting is different from my user than from root.
I renamed .vim and .vimrc, but still the highlighting is different.
So something is amiss, and I don't know what it is.
But for the purpose of the same problem, both show messed up highlighting.
Here is the sample script, with messed up colors inside parens
#!/bin/sh
GLOBAL=hello
func() {
LOCAL=hi
echo $GLOBAL
echo This goes to stdout
echo This goes to sterr >&2
}
# This is a first comment, correct comment color
(
LOCAL=hi
# This is a comment, messed up color
echo $GLOBAL
echo This goes to stdout
echo This goes to sterr >&2
) > /tmp/k 2>&1
(
# This is a comment, messed up color (same color as the
# left paren above it, and not the same color of the
# first comment
echo $LOCAL
func
) > /tmp/k 2>&1
--
Khalid M. Baheyeldin
2bits.com, Inc.
Fast Reliable Drupal
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. -- Edsger W.Dijkstra
Simplicity is the ultimate sophistication. -- Leonardo da Vinci
For every complex problem, there is an answer that is clear, simple, and
wrong." -- H.L. Mencken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20140822/e896773b/attachment.htm>
More information about the kwlug-disc
mailing list