Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #160552

Re: how execute a script

From <tomas@tuxteam.de>
Newsgroups linux.debian.user
Subject Re: how execute a script
Date 2015-11-14 08:40 +0100
Message-ID <quDBg-16e-5@gated-at.bofh.it> (permalink)
References <qun3x-77o-109@gated-at.bofh.it> <qunmO-7uR-11@gated-at.bofh.it> <quoiS-84T-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Nov 13, 2015 at 09:11:34AM -0600, David Wright wrote:
> On Fri 13 Nov 2015 at 14:43:39 (+0100), tomas@tuxteam.de wrote:
> 
> > (as an aside: it's bad custom inherited from DOS to name shell scripts
> > with an .sh ending. No ending is the right thing here).
> 
> So these were all DOS scripts once, were they?
> 
> -rwxr-xr-x 1 root root 1248 Apr 21  2014 /etc/init.d/bootmisc.sh*
> -rwxr-xr-x 1 root root 3807 Apr 21  2014 /etc/init.d/checkfs.sh*

[...]

Very smart. I didn't say the scripts are inherited from DOS. That bad
habit is, definitely.

> I name my scripts in ~/bin with an extension corresponding to their
> contents: .pl .py .sh etc. Where I'm working on alternative versions,
> I might have more than one language. Extensionless filenames are
> either links or binaries. What's bad about this? Or is it just
> snobbery: Look, we don't need extensions.

No. If you call your scripts from other places, and -- say -- change
the implementation from shell to ruby: do you have to run around and
fix all the call sites? Have fun.

The one case where an "extension" (as you call it: DOS, see?) might
make sense (I'd say a hint in the filename) is when your script isn't
an executable in itself but a collection of functions you *source*
from another shell: this so-called "shell library" has to be shell
code (i.e. you can't change implementation).

And snobbery? Pthttht.

- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlZG3AQACgkQBcgs9XrR2kb2XQCeMEBnjZw0/6L2zImjZ27pgHlI
MfoAn0dyW5n4u5XZdXzlR8XpR6DPaupL
=pM11
-----END PGP SIGNATURE-----

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

how execute a script Pol Hallen <deben@fuckaround.org> - 2015-11-13 15:00 +0100
  Re: how execute a script <tomas@tuxteam.de> - 2015-11-13 15:20 +0100
    Re: how execute a script Pol Hallen <deben@fuckaround.org> - 2015-11-13 15:50 +0100
      Re: how execute a script Lotek <lotek3@verizon.net> - 2015-11-14 01:30 +0100
      Re: how execute a script Pol Hallen <deben@fuckaround.org> - 2015-11-14 11:00 +0100
        Re: how execute a script shawn wilson <ag4ve.us@gmail.com> - 2015-11-15 15:20 +0100
    Re: how execute a script David Wright <deblis@lionunicorn.co.uk> - 2015-11-13 16:20 +0100
      Re: how execute a script Don Armstrong <don@debian.org> - 2015-11-13 18:20 +0100
        Re: how execute a script David Wright <deblis@lionunicorn.co.uk> - 2015-11-13 22:20 +0100
          Re: how execute a script Don Armstrong <don@debian.org> - 2015-11-13 23:10 +0100
            Re: how execute a script David Wright <deblis@lionunicorn.co.uk> - 2015-11-14 00:40 +0100
      Re: how execute a script <tomas@tuxteam.de> - 2015-11-14 08:40 +0100
        Re: how execute a script David Wright <deblis@lionunicorn.co.uk> - 2015-11-16 05:50 +0100
          Re: how execute a script <tomas@tuxteam.de> - 2015-11-16 10:50 +0100
            Re: how execute a script David Wright <deblis@lionunicorn.co.uk> - 2015-11-16 19:30 +0100
              Re: how execute a script <tomas@tuxteam.de> - 2015-11-17 09:20 +0100
  Re: how execute a script Gene Heskett <gheskett@shentel.net> - 2015-11-13 15:20 +0100
  Re: how execute a script Gene Heskett <gheskett@shentel.net> - 2015-11-13 15:30 +0100

csiph-web