[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how execute a script



Excuse me for reversing your paragraphs.

On Tue 17 Nov 2015 at 18:56:40 (+0000), Brian 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.

> 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.

My reaction on reading this was "that's the falt of shell completion".
After all, TAB completion, like globbing, is something that's done
before gv gets a look-in, isn't it.

In the past, I have tried to use completion when (unwisely) typing
dpkg -i (after all, who wants to type .deb filenames in full) and
failed, using the "less" command instead, and then changing
less→dpkg -i last thing.

(Aside: it also annoys me that something that will complete after a >
won't complete after a >| for some reason. As I have set -o noclobber
I have to complete after > and then insert the | last thing.)

My second reaction was to try it. It didn't work. I could type
gv /tmp/j <TAB> <TAB> and get gv /tmp/jj/jupe completed for me.
I did test that gv wasn't fooled by giving it the same pdf file
as jupe.ps jupe.jpg etc.

> 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.
> 
> Your example is?

Well, the obvious one is gcc:

$ gcc lsls.c ← writes a.out which I now delete.
$ gcc lsls.s 
lsls.s: Assembler messages:
lsls.s:8: Error: junk `(int argc,char* argv[])' after expression
lsls.s:8: Error: operand size mismatch for `int'
lsls.s:9: Error: junk at end of line, first unrecognized character is `{'
lsls.s:10: Error: no such instruction: `dir *mydir'

etc.

$ gcc lsls
lsls: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
$ 

Cheers,
David.


Reply to: