Re: [SLUG] Bash Script

From: R.G. Mayhue (rmayhue@tampabay.rr.com)
Date: Mon May 30 2005 - 09:32:01 EDT


On Monday 30 May 2005 08:57 am, Paul M Foster wrote:
>
> On Mon, May 30, 2005 at 02:03:07AM -0400, Bob Stia wrote:
>
> > On Sunday 29 May 2005 02:18, Paul M Foster wrote:
> > > On Sat, May 28, 2005 at 10:31:20PM -0400, Bob Stia wrote:
> > > > On Wednesday 25 May 2005 21:27, Eben King wrote:
> > > > > On Wed, 25 May 2005, Bob Stia wrote:
>
> <snip>
>
> > >
> > > Do what I said above and let us know if the file contains those ^M
> > > (carriage return) characters.
> > >
> > > Paul
> >
> > Paul,
> >
> > Ran the "less" command. There is nothing of which you speak. FYI I got
> > the script from the SuSE list. I am positive it was created in Linux.
> >
> > Have a thought. I copied the script from the email message and then
> > modified it using Kwrite. During that process I added line feeds etc.
> > and deleted lines and seemingly unimportant spaces. I would think that
> > a text editor like Kwrite would add the proper LF and nothing else.
> >
> > Question is: Is it critical for the amount of spaces/ tabs before or
> > after a line remain exactly as in the original ?? I notice that in most
> > scripts the first character in subsequent lines are spaced back from
> > the actual start of the line.
> >
> > Maybe I should just create the script by hand using the original as a
> > guide rather than taking the original and simply modifying it.
> >
>
> Spacing isn't particularly import in scripts, neither vertical nor
> horizontal.
>
> I'm very puzzled that you didn't find anything odd. You should have, and
> I'll still bet there's something there we aren't seeing.
>
> Your comments highlight one of the reasons programmers/coders don't use
> things like Kwrite for writing scripts and programs. Programs like that
> are often geared to writing word processing documents and the like, and
> consequently insert formatting codes that make scripts and programs
> impossible to compile and run. I think Eben also mentioned at one point
> that your email client may be messing with the content one way or
> another.
>
> I agree, you should recreate the script in something that won't mess
> with the content. There are tons of programs like this, designed
> strictly to output straight text. Most of them are console programs.
> There are vi, emacs, nano, pico, joe, vim, etc. etc. My biggest caution
> here would be to ensure you copy things very exactly. One misspelling,
> and you'll have a different problem than the one you have now. Spacing
> isn't important vertically, but horizontally, it can be. Inserting a
> space where one wasn't could wreck the script. Removing spaces where
> they are already could do the same thing. Adding spaces where they
> already exist (assuming they're not within quotes) would be okay.
>
> Let us know what happens.
>
> Paul

Kwrite would not be the problem here. Kwrite is a text editor _with_ syntax
highlighting etc. More of a programmer's editor then anything else. It does
not do rich text or any other type of formatting. Actually coding is what
kwrite/kate do the best. I would not suspect kwrite here.

I copied the script from the original post and it runs without errors on my
system.

-- Rob
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:29:02 EDT