Some random thoughts and links

High performance … delivered …

This is a true story, it all started like this:

From:     me
Sent:    today
To:    someone@accenture.com
Subject:    Scripts

Hi xxx, yyy,

You probably know, but I just looked at some of your scripts and saw:

user@server scripts $ more curdate.sh
#################################################################################
#!/usr/bin/sh                                                                   #
#                                                                               #

It wont work like this, because it needs to be in the first line with no spaces in front like this:

user@server scripts $ more curdate.sh
#!/usr/bin/sh
#################################################################################
#!/usr/bin/sh                                                                   #
#                                                                               #

Regards,

zzz

this was the response:

From:    someone@accenture.com
Sent:    today
To:    me
Subject:    RE: Scripts

Hi zzz,

We use this in all our scripts this way and it works fine. Why do you think, that it is not working?

Thanks,
yyy

after providing a link to Wikipedia explaining how Unix scripts work (http://en.wikipedia.org/wiki/Shebang_(Unix) ), this was the response:

From:     someone@accenture.com
Sent:    today
To:    me
Subject:    RE: Scripts

Hi zzz,
I can see the sentence where it says refers to the characters “#!” when they are the first two characters in a text file. I do not want to discuss whether the wikipedia article is misleading or just wrong. However, our scripts are working in the way they are programmed (even if not started with an explicit shell).

I have seen a comment block which includes the shebang already a couple of times and think, that it is common practice to do so. Therefore I do not see any need for a change.

Regards,
yyy

VN:F [1.8.1_1037]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.1_1037]
Rating: 0 (from 0 votes)
Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • MaxP
    SomeOneElse@accenture:

    '#!' can be omitted if the script is made up of only system commands without internal SH directives.

    How that script is supposed to be executed?
    You're basically right, but what about execution like sh <script_name>? That line would be only a comment, correct?
  • Well ... of course one could think of situations were even the above might work, but the business-side of my blog is focussed on the financial services industry and these scripts are usually implemented in areas, where it is criticial for the client that they work 100% reliable at all times. I have no problem at all with someone who does not know how to write a script (well) and am more than happy to help, but after some research on that person's side I would have expected an "oops, sorry, I was wrong and fixed it now" rather than saying that everybody else is wrong. It's that kind of attitude I am troubled with.
blog comments powered by Disqus