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


Groups > linux.debian.user > #160616 > unrolled thread

Re: how execute a script

Started byMartin Str|mberg <ams@ludd.luth.se>
First post2015-11-16 07:00 +0100
Last post2015-11-17 19:20 +0100
Articles 20 on this page of 37 — 12 participants

Back to article view | Back to linux.debian.user

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: how execute a script Martin Str|mberg <ams@ludd.luth.se> - 2015-11-16 07:00 +0100
    Re: how execute a script Chris Bannister <cbannister@slingshot.co.nz> - 2015-11-16 07:30 +0100
    Re: how execute a script David Wright <deblis@lionunicorn.co.uk> - 2015-11-16 20:40 +0100
      Re: how execute a script Lisi Reisz <lisi.reisz@gmail.com> - 2015-11-16 23:40 +0100
        Re: how execute a script <tomas@tuxteam.de> - 2015-11-17 09:30 +0100
        Re: how execute a script shawn wilson <ag4ve.us@gmail.com> - 2015-11-17 15:40 +0100
          Re: how execute a script Chris Bannister <cbannister@slingshot.co.nz> - 2015-11-17 19:10 +0100
            Re: how execute a script shawn wilson <ag4ve.us@gmail.com> - 2015-11-17 19:10 +0100
              Re: how execute a script Elimar Riesebieter <riesebie@lxtec.de> - 2015-11-17 19:30 +0100
                Re: how execute a script shawn wilson <ag4ve.us@gmail.com> - 2015-11-17 20:10 +0100
              Re: how execute a script Brian <ad44@cityscape.co.uk> - 2015-11-17 20:00 +0100
                Re: how execute a script shawn wilson <ag4ve.us@gmail.com> - 2015-11-17 20:10 +0100
                  Re: how execute a script Brian <ad44@cityscape.co.uk> - 2015-11-17 21:00 +0100
                    Re: how execute a script shawn wilson <ag4ve.us@gmail.com> - 2015-11-17 21:00 +0100
                      Re: how execute a script shawn wilson <ag4ve.us@gmail.com> - 2015-11-17 21:10 +0100
                        Re: how execute a script shawn wilson <ag4ve.us@gmail.com> - 2015-11-17 21:20 +0100
                          Re: how execute a script <tomas@tuxteam.de> - 2015-11-17 22:00 +0100
                            Re: how execute a script shawn wilson <ag4ve.us@gmail.com> - 2015-11-17 22:20 +0100
                              Re: how execute a script tomas@tuxteam.de - 2015-11-17 23:10 +0100
                                Re: how execute a script shawn wilson <ag4ve.us@gmail.com> - 2015-11-17 23:20 +0100
                                  Re: how execute a script shawn wilson <ag4ve.us@gmail.com> - 2015-11-17 23:30 +0100
                                  Re: how execute a script tomas@tuxteam.de - 2015-11-18 09:10 +0100
                            Re: how execute a script John Hasler <jhasler@newsguy.com> - 2015-11-17 22:40 +0100
                      Re: how execute a script Brian <ad44@cityscape.co.uk> - 2015-11-17 21:30 +0100
                        Re: how execute a script Luis Felipe Tabera Alonso <taberalf@unican.es> - 2015-11-17 22:10 +0100
                          Re: how execute a script Brian <ad44@cityscape.co.uk> - 2015-11-18 00:10 +0100
                            Re: how execute a script Don Armstrong <don@debian.org> - 2015-11-18 01:10 +0100
                            Re: how execute a script <tomas@tuxteam.de> - 2015-11-18 09:30 +0100
                              Re: how execute a script David Wright <deblis@lionunicorn.co.uk> - 2015-11-18 16:00 +0100
                                Re: how execute a script <tomas@tuxteam.de> - 2015-11-18 16:20 +0100
                                  Re: how execute a script David Wright <deblis@lionunicorn.co.uk> - 2015-11-18 16:40 +0100
                Re: how execute a script David Wright <deblis@lionunicorn.co.uk> - 2015-11-17 21:20 +0100
                Re: how execute a script <tomas@tuxteam.de> - 2015-11-17 22:00 +0100
                  Re: how execute a script Brian <ad44@cityscape.co.uk> - 2015-11-18 00:10 +0100
                    Re: how execute a script <tomas@tuxteam.de> - 2015-11-18 09:30 +0100
                      Re: how execute a script Brian <ad44@cityscape.co.uk> - 2015-11-18 13:50 +0100
            Re: how execute a script <tomas@tuxteam.de> - 2015-11-17 19:20 +0100

Page 1 of 2  [1] 2  Next page →


#160616 — Re: how execute a script

FromMartin Str|mberg <ams@ludd.luth.se>
Date2015-11-16 07:00 +0100
SubjectRe: how execute a script
Message-ID<qvkZB-3jF-5@gated-at.bofh.it>
In article <qvjTP-2Cs-1@gated-at.bofh.it> David Wright <deblis@lionunicorn.co.uk> wrote:
> As for script-file extensions in DOS, there was really only .BAT
> wasn't there?, so the idea of distinguishing .bash, .csh, .py, .pl,
> .sh, .zsh etc as being inherited from DOS is difficult for me to
> understand.

Perhaps it's because (MS)DOS begat WINDOWS that only knew how to run
something based on the extension?

And that is why we shudder on the sight of a (unnecessary?) extension?


-- 
MartinS

[toc] | [next] | [standalone]


#160617

FromChris Bannister <cbannister@slingshot.co.nz>
Date2015-11-16 07:30 +0100
Message-ID<qvlsB-3IH-1@gated-at.bofh.it>
In reply to#160616
On Mon, Nov 16, 2015 at 06:54:40AM +0100, Martin Str|mberg wrote:
> In article <qvjTP-2Cs-1@gated-at.bofh.it> David Wright <deblis@lionunicorn.co.uk> wrote:
> > As for script-file extensions in DOS, there was really only .BAT
> > wasn't there?, so the idea of distinguishing .bash, .csh, .py, .pl,
> > .sh, .zsh etc as being inherited from DOS is difficult for me to
> > understand.
> 
> Perhaps it's because (MS)DOS begat WINDOWS that only knew how to run
> something based on the extension?

That's what I understood the comment to mean.

-- 
"If you're not careful, the newspapers will have you hating the people
who are being oppressed, and loving the people who are doing the 
oppressing." --- Malcolm X

[toc] | [prev] | [next] | [standalone]


#160639

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2015-11-16 20:40 +0100
Message-ID<qvxN9-33j-43@gated-at.bofh.it>
In reply to#160616
On Mon 16 Nov 2015 at 06:54:40 (+0100), Martin Str|mberg wrote:
> In article <qvjTP-2Cs-1@gated-at.bofh.it> David Wright <deblis@lionunicorn.co.uk> wrote:
> > As for script-file extensions in DOS, there was really only .BAT
> > wasn't there?, so the idea of distinguishing .bash, .csh, .py, .pl,
> > .sh, .zsh etc as being inherited from DOS is difficult for me to
> > understand.
> 
> Perhaps it's because (MS)DOS begat WINDOWS that only knew how to run
> something based on the extension?
> 
> And that is why we shudder on the sight of a (unnecessary?) extension?

I wouldn't know. My experience of windows is far less than DOS, and my
use of DOS was pretty much restricted to an AUTOEXEC.BAT that started
an emulation system which was my area of expertise. Interesting choice
of language, though; shudder.

I'm the person questioning the relevance of DOS to putting ".sh" at
the end of an on-PATH executable script's filename, when DOS was
brought up in https://lists.debian.org/debian-user/2015/11/msg00453.html

I take it there's a whole generation of folk who gained their
experience of filename endings (a less loaded word than extension)
through DOS/windows, perhaps entirely so. With it, they picked up a
load of negative associations, causing shuddering here and unhappiness
in another part of this thread.

I'm sorry for you. I didn't touch DOS until 1992-06-01 (to be precise)
about twentyone years into my computing career. To say I *used* it
would be an overstatement: I ran one package on it.

Putting meaningful endings onto filenames (excepting, I hasten to
add lest people jump down my throat, executable scripts) had been a
way of life for years. Their necessity was variable from system to
system; sometimes they were just a convention. Look at   man gcc.
It has meaningful endings. They've been there since at least
15 March 1972 when, allegedly, the number of Unix installations had
grown to 10. (At that time, gcc was obviously called cc; Stallman
hadn't yet graduated.)

As for unix scripts, well, yes, there's no *need* for any endings,
but that doesn't preclude their use. If that makes you unhappy or
into a shudderer, please get over it.

Cheers,
David.

[toc] | [prev] | [next] | [standalone]


#160644

FromLisi Reisz <lisi.reisz@gmail.com>
Date2015-11-16 23:40 +0100
Message-ID<qvABk-4Q6-13@gated-at.bofh.it>
In reply to#160639
On Monday 16 November 2015 19:33:51 David Wright wrote:
> On Mon 16 Nov 2015 at 06:54:40 (+0100), Martin Str|mberg wrote:
> > In article <qvjTP-2Cs-1@gated-at.bofh.it> David Wright 
<deblis@lionunicorn.co.uk> wrote:
> > > As for script-file extensions in DOS, there was really only .BAT
> > > wasn't there?, so the idea of distinguishing .bash, .csh, .py, .pl,
> > > .sh, .zsh etc as being inherited from DOS is difficult for me to
> > > understand.
> >
> > Perhaps it's because (MS)DOS begat WINDOWS that only knew how to run
> > something based on the extension?
> >
> > And that is why we shudder on the sight of a (unnecessary?) extension?
>
> I wouldn't know. My experience of windows is far less than DOS, and my
> use of DOS was pretty much restricted to an AUTOEXEC.BAT that started
> an emulation system which was my area of expertise. Interesting choice
> of language, though; shudder.
>
> I'm the person questioning the relevance of DOS to putting ".sh" at
> the end of an on-PATH executable script's filename, when DOS was
> brought up in https://lists.debian.org/debian-user/2015/11/msg00453.html
>
> I take it there's a whole generation of folk who gained their
> experience of filename endings (a less loaded word than extension)
> through DOS/windows, perhaps entirely so. With it, they picked up a
> load of negative associations, causing shuddering here and unhappiness
> in another part of this thread.
>
> I'm sorry for you. I didn't touch DOS until 1992-06-01 (to be precise)
> about twentyone years into my computing career. To say I *used* it
> would be an overstatement: I ran one package on it.
>
> Putting meaningful endings onto filenames (excepting, I hasten to
> add lest people jump down my throat, executable scripts) had been a
> way of life for years. Their necessity was variable from system to
> system; sometimes they were just a convention. Look at   man gcc.
> It has meaningful endings. They've been there since at least
> 15 March 1972 when, allegedly, the number of Unix installations had
> grown to 10. (At that time, gcc was obviously called cc; Stallman
> hadn't yet graduated.)
>
> As for unix scripts, well, yes, there's no *need* for any endings,
> but that doesn't preclude their use. If that makes you unhappy or
> into a shudderer, please get over it.

I take it those who are so against file endings are equally upset by 
sources.list and menu.lst?
 
Though it is very annoying when they are *needed*.  Xsane usually puts them 
in, and I used not to bother to check.  A few months ago I sent my lawyer a 
scan of a document he needed.  An hour or two later, back came an 
email:  "I'm so sorry, we have no software that can open that file.  The IT 
department has been trying for an hour".  Puzzled, because I thought I had 
sent a .pdf, and had checked that it opened fine in Evince, I looked at the 
file - groaned - and renamed scan-foo to scan-foo.pdf.  When resent it opened 
fine.

Lisi

[toc] | [prev] | [next] | [standalone]


#160661

From<tomas@tuxteam.de>
Date2015-11-17 09:30 +0100
Message-ID<qvJOi-2w8-9@gated-at.bofh.it>
In reply to#160644
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Nov 16, 2015 at 10:37:28PM +0000, Lisi Reisz wrote:

[...]

> I take it those who are so against file endings are equally upset by 
> sources.list and menu.lst?

I don't know who "those who are so against file endings" are, in your mind.

To (preemptively) take myself out of this set, let me quote myself:

      I have no problems with the convention to end C source files with
    ".c" and objects with ".o" (after all, this makes writing makefiles
    easier!). But look at the ugly things Windows folks do ("Makefile.mak",
    horrors!) just because, with their slavish DOS roots, every file gotta
    have an extension).

    Conventions are good, slavery is bad. Or some such :-) 

To recap, and simplifying very much. IMHO IMHO IMHO:

  executable script, independently of "interpreter" [1]
    ending -> BAD
  shell, perl, any other (eg dynamic) library
    ending -> GOOD
  pdf, jpeg, tar.gz
    ending -> GOOD

> Though it is very annoying when they are *needed*.  Xsane usually puts them 
> in, and I used not to bother to check.  A few months ago I sent my lawyer a 
> scan of a document he needed.  An hour or two later, back came an 
> email:  "I'm so sorry, we have no software that can open that file.  The IT 
> department has been trying for an hour".  Puzzled, because I thought I had 
> sent a .pdf, and had checked that it opened fine in Evince, I looked at the 
> file - groaned - and renamed scan-foo to scan-foo.pdf.  When resent it opened 
> fine.

Software relying more on that ending than on what the user says ("believe me,
that *is* a pdf although the ending is not") is downright stupid, and you'll
find that more on Windows than on Linux (although Linux has a fair, and
increasing share of it).

I know this experience. Unless you name a file "foo.txt" stupid Word can't
open it (yeah, you can force it to, but Windows has "educated" its users
to be so helpless that they mostly wouldn't know how to). That's what I
was talking about when I mentioned "slavery".

Hope my point is clearer now.

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

iEYEARECAAYFAlZK3NAACgkQBcgs9XrR2kYhDACbB5F2VgQKSE72bPbp//asZ0Y3
Ey8An3rxzjSaAo3fCS0/zF4CIyIBCiBZ
=Ulbs
-----END PGP SIGNATURE-----

[toc] | [prev] | [next] | [standalone]


#160670

Fromshawn wilson <ag4ve.us@gmail.com>
Date2015-11-17 15:40 +0100
Message-ID<qvPAm-6eh-17@gated-at.bofh.it>
In reply to#160644

[Multipart message — attachments visible in raw view] — view raw

On Nov 16, 2015 5:37 PM, "Lisi Reisz" <lisi.reisz@gmail.com> wrote:
>
> On Monday 16 November 2015 19:33:51 David Wright wrote:
> > On Mon 16 Nov 2015 at 06:54:40 (+0100), Martin Str|mberg wrote:
> > > In article <qvjTP-2Cs-1@gated-at.bofh.it> David Wright
> <deblis@lionunicorn.co.uk> wrote:
> > > > As for script-file extensions in DOS, there was really only .BAT
> > > > wasn't there?, so the idea of distinguishing .bash, .csh, .py, .pl,
> > > > .sh, .zsh etc as being inherited from DOS is difficult for me to
> > > > understand.
> > >
> > > Perhaps it's because (MS)DOS begat WINDOWS that only knew how to run
> > > something based on the extension?
> > >
> > > And that is why we shudder on the sight of a (unnecessary?) extension?
> >
> > I wouldn't know. My experience of windows is far less than DOS, and my
> > use of DOS was pretty much restricted to an AUTOEXEC.BAT that started
> > an emulation system which was my area of expertise. Interesting choice
> > of language, though; shudder.
> >
> > I'm the person questioning the relevance of DOS to putting ".sh" at
> > the end of an on-PATH executable script's filename, when DOS was
> > brought up in https://lists.debian.org/debian-user/2015/11/msg00453.html
> >
> > I take it there's a whole generation of folk who gained their
> > experience of filename endings (a less loaded word than extension)
> > through DOS/windows, perhaps entirely so. With it, they picked up a
> > load of negative associations, causing shuddering here and unhappiness
> > in another part of this thread.
> >
> > I'm sorry for you. I didn't touch DOS until 1992-06-01 (to be precise)
> > about twentyone years into my computing career. To say I *used* it
> > would be an overstatement: I ran one package on it.
> >
> > Putting meaningful endings onto filenames (excepting, I hasten to
> > add lest people jump down my throat, executable scripts) had been a
> > way of life for years. Their necessity was variable from system to
> > system; sometimes they were just a convention. Look at   man gcc.
> > It has meaningful endings. They've been there since at least
> > 15 March 1972 when, allegedly, the number of Unix installations had
> > grown to 10. (At that time, gcc was obviously called cc; Stallman
> > hadn't yet graduated.)
> >
> > As for unix scripts, well, yes, there's no *need* for any endings,
> > but that doesn't preclude their use. If that makes you unhappy or
> > into a shudderer, please get over it.
>
> I take it those who are so against file endings are equally upset by
> sources.list and menu.lst?
>
> Though it is very annoying when they are *needed*.  Xsane usually puts
them
> in, and I used not to bother to check.  A few months ago I sent my lawyer
a
> scan of a document he needed.  An hour or two later, back came an
> email:  "I'm so sorry, we have no software that can open that file.  The
IT
> department has been trying for an hour".  Puzzled, because I thought I had
> sent a .pdf, and had checked that it opened fine in Evince, I looked at
the
> file - groaned - and renamed scan-foo to scan-foo.pdf.  When resent it
opened
> fine.
>

Magic shouldn't be used when a file type is known and should be
communicated (via its extension). If you create a pdf, it is bad to not
have the pdf extension - you've lost data.

Also, I'm fine with installed executables not including extensions.
However, in a repo with different types of executable code, I want to know
at a glance what something is (there's also that vim filetype uses
extension and I want stuff to work).

[toc] | [prev] | [next] | [standalone]


#160676

FromChris Bannister <cbannister@slingshot.co.nz>
Date2015-11-17 19:10 +0100
Message-ID<qvSRA-8wu-13@gated-at.bofh.it>
In reply to#160670
On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote:
> On Nov 16, 2015 5:37 PM, "Lisi Reisz" <lisi.reisz@gmail.com> wrote:
> > department has been trying for an hour".  Puzzled, because I thought I had
> > sent a .pdf, and had checked that it opened fine in Evince, I looked at
> the
> > file - groaned - and renamed scan-foo to scan-foo.pdf.  When resent it
> 
> communicated (via its extension). If you create a pdf, it is bad to not
> have the pdf extension - you've lost data.

How have you lost data? 

-- 
"If you're not careful, the newspapers will have you hating the people
who are being oppressed, and loving the people who are doing the 
oppressing." --- Malcolm X

[toc] | [prev] | [next] | [standalone]


#160677

Fromshawn wilson <ag4ve.us@gmail.com>
Date2015-11-17 19:10 +0100
Message-ID<qvSRA-8wu-19@gated-at.bofh.it>
In reply to#160676
On Tue, Nov 17, 2015 at 1:02 PM, Chris Bannister
<cbannister@slingshot.co.nz> wrote:
> On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote:
>> On Nov 16, 2015 5:37 PM, "Lisi Reisz" <lisi.reisz@gmail.com> wrote:
>> > department has been trying for an hour".  Puzzled, because I thought I had
>> > sent a .pdf, and had checked that it opened fine in Evince, I looked at
>> the
>> > file - groaned - and renamed scan-foo to scan-foo.pdf.  When resent it
>>
>> communicated (via its extension). If you create a pdf, it is bad to not
>> have the pdf extension - you've lost data.
>
> How have you lost data?
>

You loose what the file type (data) should be if you save a file w/o
an extension. Again, this is fine for an installed program (no one
cares as long as it works) but not so good for data that is processed
by another program or a script I want to edit.

[toc] | [prev] | [next] | [standalone]


#160682

FromElimar Riesebieter <riesebie@lxtec.de>
Date2015-11-17 19:30 +0100
Message-ID<qvTaV-bm-1@gated-at.bofh.it>
In reply to#160677
* shawn wilson <ag4ve.us@gmail.com> [2015-11-17 13:08 -0500]:

> On Tue, Nov 17, 2015 at 1:02 PM, Chris Bannister
> <cbannister@slingshot.co.nz> wrote:
> > On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote:

[...]

> >> communicated (via its extension). If you create a pdf, it is bad to not
> >> have the pdf extension - you've lost data.
> >
> > How have you lost data?
> >
> 
> You loose what the file type (data) should be if you save a file w/o
> an extension. Again, this is fine for an installed program (no one
> cares as long as it works) but not so good for data that is processed
> by another program or a script I want to edit.

PDF files are recognized by their header not their extension. Create
a test.pdf. Copy it to test and test.blo. They will always be
recognized as pdf documents from evince and alike.

Elimar
-- 
 >what IMHO then?
  IMHO - Inhalation of a Multi-leafed Herbal Opiate ;)
              --posting from alex in debian-user--

[toc] | [prev] | [next] | [standalone]


#160689

Fromshawn wilson <ag4ve.us@gmail.com>
Date2015-11-17 20:10 +0100
Message-ID<qvTND-EM-1@gated-at.bofh.it>
In reply to#160682
On Tue, Nov 17, 2015 at 1:25 PM, Elimar Riesebieter <riesebie@lxtec.de> wrote:
> * shawn wilson <ag4ve.us@gmail.com> [2015-11-17 13:08 -0500]:
>
>> On Tue, Nov 17, 2015 at 1:02 PM, Chris Bannister
>> <cbannister@slingshot.co.nz> wrote:
>> > On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote:
>
> [...]
>
>> >> communicated (via its extension). If you create a pdf, it is bad to not
>> >> have the pdf extension - you've lost data.
>> >
>> > How have you lost data?
>> >
>>
>> You loose what the file type (data) should be if you save a file w/o
>> an extension. Again, this is fine for an installed program (no one
>> cares as long as it works) but not so good for data that is processed
>> by another program or a script I want to edit.
>
> PDF files are recognized by their header not their extension. Create
> a test.pdf. Copy it to test and test.blo. They will always be
> recognized as pdf documents from evince and alike.
>

Quoting myself (sorry):
> Magic shouldn't be used when a file type is known

[toc] | [prev] | [next] | [standalone]


#160687

FromBrian <ad44@cityscape.co.uk>
Date2015-11-17 20:00 +0100
Message-ID<qvTDY-m1-5@gated-at.bofh.it>
In reply to#160677
On Tue 17 Nov 2015 at 13:08:49 -0500, shawn wilson wrote:

> On Tue, Nov 17, 2015 at 1:02 PM, Chris Bannister
> <cbannister@slingshot.co.nz> wrote:
> > On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote:
> >> On Nov 16, 2015 5:37 PM, "Lisi Reisz" <lisi.reisz@gmail.com> wrote:
> >> > department has been trying for an hour".  Puzzled, because I thought I had
> >> > sent a .pdf, and had checked that it opened fine in Evince, I looked at
> >> the
> >> > file - groaned - and renamed scan-foo to scan-foo.pdf.  When resent it
> >>
> >> communicated (via its extension). If you create a pdf, it is bad to not
> >> have the pdf extension - you've lost data.
> >
> > How have you lost data?
> 
> You loose what the file type (data) should be if you save a file w/o
> an extension. Again, this is fine for an installed program (no one
> cares as long as it works) but not so good for data that is processed
> by another program or a script I want to edit.

You would have to give a specific example where a file processed by a
program or script fails to open for this argument to be convincing, You
also have to distinguish between data in the file and information the
extension conveys to the program.

My example: gv does not recognise the PDF file 'test' as something it is
*capable of opening*. With 'test' as the only file in a directory the
command gv plus TAB completion doesn't produce 'gv test'. But 'gv test'
opens the file, which is all that matters.

Your example is?

[toc] | [prev] | [next] | [standalone]


#160691

Fromshawn wilson <ag4ve.us@gmail.com>
Date2015-11-17 20:10 +0100
Message-ID<qvTND-EM-11@gated-at.bofh.it>
In reply to#160687
On Tue, Nov 17, 2015 at 1:56 PM, Brian <ad44@cityscape.co.uk> wrote:
> On Tue 17 Nov 2015 at 13:08:49 -0500, shawn wilson wrote:
>
>> On Tue, Nov 17, 2015 at 1:02 PM, Chris Bannister
>> <cbannister@slingshot.co.nz> wrote:
>> > On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote:
>> >> On Nov 16, 2015 5:37 PM, "Lisi Reisz" <lisi.reisz@gmail.com> wrote:
>> >> > department has been trying for an hour".  Puzzled, because I thought I had
>> >> > sent a .pdf, and had checked that it opened fine in Evince, I looked at
>> >> the
>> >> > file - groaned - and renamed scan-foo to scan-foo.pdf.  When resent it
>> >>
>> >> communicated (via its extension). If you create a pdf, it is bad to not
>> >> have the pdf extension - you've lost data.
>> >
>> > How have you lost data?
>>
>> You loose what the file type (data) should be if you save a file w/o
>> an extension. Again, this is fine for an installed program (no one
>> cares as long as it works) but not so good for data that is processed
>> by another program or a script I want to edit.
>
> You would have to give a specific example where a file processed by a
> program or script fails to open for this argument to be convincing, You
> also have to distinguish between data in the file and information the
> extension conveys to the program.
>

How about just that vim filetype relies on the filename to determine the format?

I suspect there are other examples where an extension might be
*required* such as compression, but other than Windows, IDK off hand.

[toc] | [prev] | [next] | [standalone]


#160692

FromBrian <ad44@cityscape.co.uk>
Date2015-11-17 21:00 +0100
Message-ID<qvUA1-Xn-1@gated-at.bofh.it>
In reply to#160691
On Tue 17 Nov 2015 at 14:05:25 -0500, shawn wilson wrote:

> On Tue, Nov 17, 2015 at 1:56 PM, Brian <ad44@cityscape.co.uk> wrote:
> > On Tue 17 Nov 2015 at 13:08:49 -0500, shawn wilson wrote:
> >
> >> On Tue, Nov 17, 2015 at 1:02 PM, Chris Bannister
> >> <cbannister@slingshot.co.nz> wrote:
> >> > On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote:
> >> >> On Nov 16, 2015 5:37 PM, "Lisi Reisz" <lisi.reisz@gmail.com> wrote:
> >> >> > department has been trying for an hour".  Puzzled, because I thought I had
> >> >> > sent a .pdf, and had checked that it opened fine in Evince, I looked at
> >> >> the
> >> >> > file - groaned - and renamed scan-foo to scan-foo.pdf.  When resent it
> >> >>
> >> >> communicated (via its extension). If you create a pdf, it is bad to not
> >> >> have the pdf extension - you've lost data.
> >> >
> >> > How have you lost data?
> >>
> >> You loose what the file type (data) should be if you save a file w/o
> >> an extension. Again, this is fine for an installed program (no one
> >> cares as long as it works) but not so good for data that is processed
> >> by another program or a script I want to edit.
> >
> > You would have to give a specific example where a file processed by a
> > program or script fails to open for this argument to be convincing, You
> > also have to distinguish between data in the file and information the
> > extension conveys to the program.
> 
> How about just that vim filetype relies on the filename to determine the format?

"vim filetype". I don't know what you mean. 'vim /usr/bin/vim' opens the
file.  I do not understand a word of the display but it does open it. An
extension doesn't seem to have a part to play in the file's opening.

> I suspect there are other examples where an extension might be
> *required* such as compression, but other than Windows, IDK off hand.

You haven't yet given an example of any such requirement in Debian.

[toc] | [prev] | [next] | [standalone]


#160693

Fromshawn wilson <ag4ve.us@gmail.com>
Date2015-11-17 21:00 +0100
Message-ID<qvUA1-Xn-9@gated-at.bofh.it>
In reply to#160692
On Tue, Nov 17, 2015 at 2:53 PM, Brian <ad44@cityscape.co.uk> wrote:
> On Tue 17 Nov 2015 at 14:05:25 -0500, shawn wilson wrote:
>
>> On Tue, Nov 17, 2015 at 1:56 PM, Brian <ad44@cityscape.co.uk> wrote:
>> > On Tue 17 Nov 2015 at 13:08:49 -0500, shawn wilson wrote:
>> >
>> >> On Tue, Nov 17, 2015 at 1:02 PM, Chris Bannister
>> >> <cbannister@slingshot.co.nz> wrote:
>> >> > On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote:
>> >> >> On Nov 16, 2015 5:37 PM, "Lisi Reisz" <lisi.reisz@gmail.com> wrote:
>> >> >> > department has been trying for an hour".  Puzzled, because I thought I had
>> >> >> > sent a .pdf, and had checked that it opened fine in Evince, I looked at
>> >> >> the
>> >> >> > file - groaned - and renamed scan-foo to scan-foo.pdf.  When resent it
>> >> >>
>> >> >> communicated (via its extension). If you create a pdf, it is bad to not
>> >> >> have the pdf extension - you've lost data.
>> >> >
>> >> > How have you lost data?
>> >>
>> >> You loose what the file type (data) should be if you save a file w/o
>> >> an extension. Again, this is fine for an installed program (no one
>> >> cares as long as it works) but not so good for data that is processed
>> >> by another program or a script I want to edit.
>> >
>> > You would have to give a specific example where a file processed by a
>> > program or script fails to open for this argument to be convincing, You
>> > also have to distinguish between data in the file and information the
>> > extension conveys to the program.
>>
>> How about just that vim filetype relies on the filename to determine the format?
>
> "vim filetype". I don't know what you mean. 'vim /usr/bin/vim' opens the
> file.  I do not understand a word of the display but it does open it. An
> extension doesn't seem to have a part to play in the file's opening.
>

Your way of setting filetype is by looking at the extension - for example:
:autocmd BufRead *.js set filetype=javascript

Same goes for *.pl or *.pm or *.py or *.c, etc

[toc] | [prev] | [next] | [standalone]


#160694

Fromshawn wilson <ag4ve.us@gmail.com>
Date2015-11-17 21:10 +0100
Message-ID<qvUJI-1gq-19@gated-at.bofh.it>
In reply to#160693
On Tue, Nov 17, 2015 at 2:57 PM, shawn wilson <ag4ve.us@gmail.com> wrote:
> On Tue, Nov 17, 2015 at 2:53 PM, Brian <ad44@cityscape.co.uk> wrote:
>> On Tue 17 Nov 2015 at 14:05:25 -0500, shawn wilson wrote:
>>
>>> On Tue, Nov 17, 2015 at 1:56 PM, Brian <ad44@cityscape.co.uk> wrote:
>>> > On Tue 17 Nov 2015 at 13:08:49 -0500, shawn wilson wrote:
>>> >
>>> >> On Tue, Nov 17, 2015 at 1:02 PM, Chris Bannister
>>> >> <cbannister@slingshot.co.nz> wrote:
>>> >> > On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote:
>>> >> >> On Nov 16, 2015 5:37 PM, "Lisi Reisz" <lisi.reisz@gmail.com> wrote:
>>> >> >> > department has been trying for an hour".  Puzzled, because I thought I had
>>> >> >> > sent a .pdf, and had checked that it opened fine in Evince, I looked at
>>> >> >> the
>>> >> >> > file - groaned - and renamed scan-foo to scan-foo.pdf.  When resent it
>>> >> >>
>>> >> >> communicated (via its extension). If you create a pdf, it is bad to not
>>> >> >> have the pdf extension - you've lost data.
>>> >> >
>>> >> > How have you lost data?
>>> >>
>>> >> You loose what the file type (data) should be if you save a file w/o
>>> >> an extension. Again, this is fine for an installed program (no one
>>> >> cares as long as it works) but not so good for data that is processed
>>> >> by another program or a script I want to edit.
>>> >
>>> > You would have to give a specific example where a file processed by a
>>> > program or script fails to open for this argument to be convincing, You
>>> > also have to distinguish between data in the file and information the
>>> > extension conveys to the program.
>>>
>>> How about just that vim filetype relies on the filename to determine the format?
>>
>> "vim filetype". I don't know what you mean. 'vim /usr/bin/vim' opens the
>> file.  I do not understand a word of the display but it does open it. An
>> extension doesn't seem to have a part to play in the file's opening.
>>
>
> Your way of setting filetype is by looking at the extension - for example:
> :autocmd BufRead *.js set filetype=javascript
>
> Same goes for *.pl or *.pm or *.py or *.c, etc

Here's another example of magic failing:

 % file t.sh

Downloads/temp swlap1
t.sh: ASCII text
 % cat t.sh

Downloads/temp swlap1
max=10

echo "HERE 1"
for (( count = 0; count <= max; count++ )) ; do
  echo "$count"
  sleep "${sleep:-0}"
done
echo "HERE 2"
 % ./t.sh

Downloads/temp swlap1
HERE 1

0
1
2
3
4
5
6
7
8
9
10
HERE 2

[toc] | [prev] | [next] | [standalone]


#160697

Fromshawn wilson <ag4ve.us@gmail.com>
Date2015-11-17 21:20 +0100
Message-ID<qvUTo-1l2-21@gated-at.bofh.it>
In reply to#160694
>  % file t.sh
> t.sh: ASCII text
>  % cat t.sh
> max=10
>

Oh and before someone says "but there's some standard that says you're
supposed to put a shebang at the top" - afaik, it's not in POSIX
anywhere:
http://www.in-ulm.de/~mascheck/various/shebang/

So, magic dropped the ball - should've been identified as a shell
script (due to the use of "echo"

[toc] | [prev] | [next] | [standalone]


#160699

From<tomas@tuxteam.de>
Date2015-11-17 22:00 +0100
Message-ID<qvVw6-1Ai-9@gated-at.bofh.it>
In reply to#160697
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Nov 17, 2015 at 03:15:21PM -0500, shawn wilson wrote:
> >  % file t.sh
> > t.sh: ASCII text
> >  % cat t.sh
> > max=10
> >
> 
> Oh and before someone says "but there's some standard that says you're
> supposed to put a shebang at the top" - afaik, it's not in POSIX
> anywhere:
> http://www.in-ulm.de/~mascheck/various/shebang/

You forgot to mention that it's in AT&T Unix since 1979. I'd venture to
say that nowadays it is an integral part of Unix.

> So, magic dropped the ball - should've been identified as a shell
> script (due to the use of "echo"

Now you lost me.

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

iEYEARECAAYFAlZLjOgACgkQBcgs9XrR2kbCCQCeJuta2EiilKsRml49QQdRvgo2
lAIAn2ZaVmWvqAp6qi2i3AMArSLnaJGj
=HPu2
-----END PGP SIGNATURE-----

[toc] | [prev] | [next] | [standalone]


#160702

Fromshawn wilson <ag4ve.us@gmail.com>
Date2015-11-17 22:20 +0100
Message-ID<qvVPt-1Xk-25@gated-at.bofh.it>
In reply to#160699
On Tue, Nov 17, 2015 at 3:24 PM,  <tomas@tuxteam.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Tue, Nov 17, 2015 at 03:15:21PM -0500, shawn wilson wrote:
>> >  % file t.sh
>> > t.sh: ASCII text
>> >  % cat t.sh
>> > max=10
>> >
>>
>> Oh and before someone says "but there's some standard that says you're
>> supposed to put a shebang at the top" - afaik, it's not in POSIX
>> anywhere:
>> http://www.in-ulm.de/~mascheck/various/shebang/
>
> You forgot to mention that it's in AT&T Unix since 1979. I'd venture to
> say that nowadays it is an integral part of Unix.
>

Merely pointing out it's not a spec. But yeah, it's older than me :)

>> So, magic dropped the ball - should've been identified as a shell
>> script (due to the use of "echo"
>
> Now you lost me.
>

If magic were smarter (was able to derive from syntax or had regex
capability in the format), it could've still told me I was looking at
a script (and not just a bunch of text - which is next to useless). It
doesn't, so arguing that magic could be used (not an argument I've
seen, but one I was expecting and figured I'd preempt) instead of an
extension is lacking.

[toc] | [prev] | [next] | [standalone]


#160704

Fromtomas@tuxteam.de
Date2015-11-17 23:10 +0100
Message-ID<qvWBQ-2uT-3@gated-at.bofh.it>
In reply to#160702
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Nov 17, 2015 at 04:13:48PM -0500, shawn wilson wrote:
> On Tue, Nov 17, 2015 at 3:24 PM,  <tomas@tuxteam.de> wrote:

[...]

> > Now you lost me.
> >
> 
> If magic were smarter (was able to derive from syntax or had regex
> capability in the format), it could've still told me I was looking at
> a script (and not just a bunch of text - which is next to useless). It
> doesn't, so arguing that magic could be used (not an argument I've
> seen, but one I was expecting and figured I'd preempt) instead of an
> extension is lacking.

Got it. But magic *can* do many of those things. A headless shell
script is a tough nut to crack, though: "echo" could occur as well
in a Tcl script (via Tcl's crazy but genius "unknown" mechanism).

Start here[1] if you want to have some fun :-)

[1] <https://en.wikipedia.org/wiki/Polyglot_(computing)>

regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlZLm2MACgkQBcgs9XrR2kZQaACfUEYXN1YCBt94CoWABtYuzl+v
AsUAn04zBdR0IFSEy/As5nnHii3/ixU0
=gzE/
-----END PGP SIGNATURE-----

[toc] | [prev] | [next] | [standalone]


#160705

Fromshawn wilson <ag4ve.us@gmail.com>
Date2015-11-17 23:20 +0100
Message-ID<qvWLv-2zc-1@gated-at.bofh.it>
In reply to#160704
On Tue, Nov 17, 2015 at 4:25 PM,  <tomas@tuxteam.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Tue, Nov 17, 2015 at 04:13:48PM -0500, shawn wilson wrote:
>> On Tue, Nov 17, 2015 at 3:24 PM,  <tomas@tuxteam.de> wrote:
>
> [...]
>
>> > Now you lost me.
>> >
>>
>> If magic were smarter (was able to derive from syntax or had regex
>> capability in the format), it could've still told me I was looking at
>> a script (and not just a bunch of text - which is next to useless). It
>> doesn't, so arguing that magic could be used (not an argument I've
>> seen, but one I was expecting and figured I'd preempt) instead of an
>> extension is lacking.
>
> Got it. But magic *can* do many of those things. A headless shell
> script is a tough nut to crack, though: "echo" could occur as well
> in a Tcl script (via Tcl's crazy but genius "unknown" mechanism).
>

You're right - just "script" then. I'm not dissing magic - it's a good
starting point in forensics or to see what's in a bin directory, but
shouldn't be relied on (also see ftimes xmagic for a more featureful
magic implementation w/e sf comes back up).

My point is that you can't determine what you're looking at w/o being
told (an extension) or looking at it. So (my original point) you loose
data by removing/not having an extension.

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | linux.debian.user


csiph-web