Re: script: test binary program vs shell script

2009-04-16 Thread Chris Burkhardt
Kevin Ponds wrote: >>> or something along those lines. Grepping fo "ELF" can also be useful. >>> > > Grepping for ELF is a dangerous way to do it! If you run the script on > itself, > it will think that it's a binary. I think he meant grep'ing for 'ELF' in the output of the file command, not th

Re: script: test binary program vs shell script

2009-04-16 Thread Eric De Mund
All, Jerome BENOIT : > in side a bash script, I would like to test is a given program is > either a binary file or a script file: is there way to so ? "file -iL" might be what you're looking for. "-i" for mime type output, "-L" to follow symbolic links: % file -iL config.guess spamassassin u

Re: script: test binary program vs shell script

2009-04-16 Thread Kevin Ponds
Jerome BENOIT mailsnare.net> writes: > > I came to this solution too ! > > Thanks, > Jerome > > Eduardo M KALINOWSKI wrote: > > or something along those lines. Grepping fo "ELF" can also be useful. > > > Grepping for ELF is a dangerous way to do it! If you run the script on itself, it will

Re: script: test binary program vs shell script

2009-04-16 Thread Jerome BENOIT
I came to this solution too ! Thanks, Jerome Eduardo M KALINOWSKI wrote: Jerome BENOIT wrote: Eduardo M KALINOWSKI wrote: On Qui, 16 Abr 2009, "Jerome BENOIT" wrote: Hello List, in side a bash script, I would like to test is a given program is either a binary file or a script file:

Re: script: test binary program vs shell script

2009-04-16 Thread Eduardo M KALINOWSKI
Jerome BENOIT wrote: > Eduardo M KALINOWSKI wrote: > >> On Qui, 16 Abr 2009, "Jerome BENOIT" wrote: >> >>> Hello List, >>> >>> in side a bash script, I would like to test is a given program >>> is either a binary file or a script file: >>> is there way to so ? >>> >> file /path/to/pr

Re: script: test binary program vs shell script

2009-04-16 Thread Jerome BENOIT
Hello, thanks for the reply. Eduardo M KALINOWSKI wrote: On Qui, 16 Abr 2009, "Jerome BENOIT" wrote: Hello List, in side a bash script, I would like to test is a given program is either a binary file or a script file: is there way to so ? file /path/to/program I know file: file /path/to/p

Re: script: test binary program vs shell script

2009-04-16 Thread Eduardo M KALINOWSKI
On Qui, 16 Abr 2009, "Jerome BENOIT" wrote: Hello List, in side a bash script, I would like to test is a given program is either a binary file or a script file: is there way to so ? file /path/to/program should give the information you need. -- Eduardo M KALINOWSKI edua...@kalinowski.com.br

script: test binary program vs shell script

2009-04-16 Thread Jerome BENOIT
Hello List, in side a bash script, I would like to test is a given program is either a binary file or a script file: is there way to so ? Thanks in advance, Jerome -- Jerome BENOIT jgmbenoit_at_mailsnare_dot_net -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject