Re: how execute a script

2015-11-18 Thread David Wright
On Wed 18 Nov 2015 at 15:42:44 (+0100), to...@tuxteam.de wrote: > On Wed, Nov 18, 2015 at 08:54:46AM -0600, David Wright wrote: > > On Wed 18 Nov 2015 at 08:47:59 (+0100), to...@tuxteam.de wrote: > > > > > Here, gunzip is seeing the file name. Since gzip, by convention, removes > > > the original

Re: how execute a script

2015-11-18 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, Nov 18, 2015 at 08:54:46AM -0600, David Wright wrote: > On Wed 18 Nov 2015 at 08:47:59 (+0100), to...@tuxteam.de wrote: > > > Here, gunzip is seeing the file name. Since gzip, by convention, removes > > the original (and gunzip the compressed)

Re: how execute a script

2015-11-18 Thread David Wright
On Wed 18 Nov 2015 at 08:47:59 (+0100), to...@tuxteam.de wrote: > Here, gunzip is seeing the file name. Since gzip, by convention, removes > the original (and gunzip the compressed), effectively replacing each by > the other), those programs are extra careful. The file name pattern is > part of th

Re: how execute a script

2015-11-18 Thread Brian
On Wed 18 Nov 2015 at 08:49:13 +0100, to...@tuxteam.de wrote: > On Tue, Nov 17, 2015 at 11:08:24PM +, Brian wrote: > > On Tue 17 Nov 2015 at 21:18:57 +0100, to...@tuxteam.de wrote: > > > > > On Tue, Nov 17, 2015 at 06:56:40PM +, Brian wrote: > > > > > > [...] > > > > > > > My example: g

Re: how execute a script

2015-11-18 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tue, Nov 17, 2015 at 11:08:24PM +, Brian wrote: > On Tue 17 Nov 2015 at 21:18:57 +0100, to...@tuxteam.de wrote: > > > On Tue, Nov 17, 2015 at 06:56:40PM +, Brian wrote: > > > > [...] > > > > > My example: gv does not recognise the PDF fil

Re: how execute a script

2015-11-18 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tue, Nov 17, 2015 at 11:08:46PM +, Brian wrote: > On Tue 17 Nov 2015 at 21:41:01 +0100, Luis Felipe Tabera Alonso wrote: > > > On Tuesday 17 November 2015 20:21:23 Brian wrote: > > > > > > I've also asked for a *concrete example* of a program

Re: how execute a script

2015-11-18 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tue, Nov 17, 2015 at 05:17:46PM -0500, shawn wilson wrote: [...] > > 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

Re: how execute a script

2015-11-17 Thread Don Armstrong
On Tue, 17 Nov 2015, Brian wrote: > $mv file other. > $gunzip -S . other. > $ls > other > > gunzip is a tool that does seem to care what the files are named. See the --no-name/--name option. By default the name and timestamp of the uncompressed file is saved when the file is compressed s

Re: how execute a script

2015-11-17 Thread Brian
On Tue 17 Nov 2015 at 21:41:01 +0100, Luis Felipe Tabera Alonso wrote: > On Tuesday 17 November 2015 20:21:23 Brian wrote: > > > > I've also asked for a *concrete example* of a program not opening a file > > because of the lack of an extension. It hasn't yet been given. > > $ gunzip file > gzip

Re: how execute a script

2015-11-17 Thread Brian
On Tue 17 Nov 2015 at 21:18:57 +0100, to...@tuxteam.de wrote: > On Tue, Nov 17, 2015 at 06:56:40PM +, Brian wrote: > > [...] > > > 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

Re: how execute a script

2015-11-17 Thread shawn wilson
On Tue, Nov 17, 2015 at 5:17 PM, shawn wilson wrote: > shouldn't be relied on (also see ftimes xmagic for a more featureful > magic implementation w/e sf comes back up). Ugh, it's back now: http://ftimes.sourceforge.net/FTimes/XMagic.shtml

Re: how execute a script

2015-11-17 Thread shawn wilson
On Tue, Nov 17, 2015 at 4:25 PM, 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, wrote: > > [...] > >> > Now you lost me. >> > >> >> If magic were smarter (was able to derive from synt

Re: how execute a script

2015-11-17 Thread tomas
-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, 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

Re: how execute a script

2015-11-17 Thread John Hasler
shawn wilson wrote: > 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/ tomas writes: > You forgot to mention that it's in AT&T Unix since 1979. I'd

Re: how execute a script

2015-11-17 Thread shawn wilson
On Tue, Nov 17, 2015 at 3:24 PM, 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 sa

Re: how execute a script

2015-11-17 Thread Luis Felipe Tabera Alonso
On Tuesday 17 November 2015 20:21:23 Brian wrote: > > I've also asked for a *concrete example* of a program not opening a file > because of the lack of an extension. It hasn't yet been given. $ gunzip file gzip: file: unknown suffix -- ignored $mv file other.gz $gunzip other.gz $ls other

Re: how execute a script

2015-11-17 Thread tomas
-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" - afa

Re: how execute a script

2015-11-17 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tue, Nov 17, 2015 at 06:56:40PM +, Brian wrote: [...] > 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 p

Re: how execute a script

2015-11-17 Thread Brian
On Tue 17 Nov 2015 at 14:57:58 -0500, shawn wilson wrote: > On Tue, Nov 17, 2015 at 2:53 PM, Brian wrote: > > On Tue 17 Nov 2015 at 14:05:25 -0500, shawn wilson wrote: > > > >> On Tue, Nov 17, 2015 at 1:56 PM, Brian wrote: > >> > On Tue 17 Nov 2015 at 13:08:49 -0500, shawn wilson wrote: > >> > >

Re: how execute a script

2015-11-17 Thread shawn wilson
> % 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

Re: how execute a script

2015-11-17 Thread David Wright
Excuse me for reversing your paragraphs. On Tue 17 Nov 2015 at 18:56:40 (+), 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 > > wrote: > > > On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote: > > >> O

Re: how execute a script

2015-11-17 Thread shawn wilson
On Tue, Nov 17, 2015 at 2:57 PM, shawn wilson wrote: > On Tue, Nov 17, 2015 at 2:53 PM, Brian wrote: >> On Tue 17 Nov 2015 at 14:05:25 -0500, shawn wilson wrote: >> >>> On Tue, Nov 17, 2015 at 1:56 PM, Brian wrote: >>> > On Tue 17 Nov 2015 at 13:08:49 -0500, shawn wilson wrote: >>> > >>> >> On T

Re: how execute a script

2015-11-17 Thread shawn wilson
On Tue, Nov 17, 2015 at 2:53 PM, Brian wrote: > On Tue 17 Nov 2015 at 14:05:25 -0500, shawn wilson wrote: > >> On Tue, Nov 17, 2015 at 1:56 PM, 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 >> >> wrote: >>

Re: how execute a script

2015-11-17 Thread Brian
On Tue 17 Nov 2015 at 14:05:25 -0500, shawn wilson wrote: > On Tue, Nov 17, 2015 at 1:56 PM, 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 > >> wrote: > >> > On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wil

Re: how execute a script

2015-11-17 Thread shawn wilson
On Tue, Nov 17, 2015 at 1:56 PM, 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 >> wrote: >> > On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote: >> >> On Nov 16, 2015 5:37 PM, "Lisi Reisz" wrote: >> >> >

Re: how execute a script

2015-11-17 Thread shawn wilson
On Tue, Nov 17, 2015 at 1:25 PM, Elimar Riesebieter wrote: > * shawn wilson [2015-11-17 13:08 -0500]: > >> On Tue, Nov 17, 2015 at 1:02 PM, Chris Bannister >> wrote: >> > On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote: > > [...] > >> >> communicated (via its extension). If you crea

Re: how execute a script

2015-11-17 Thread Brian
On Tue 17 Nov 2015 at 13:08:49 -0500, shawn wilson wrote: > On Tue, Nov 17, 2015 at 1:02 PM, Chris Bannister > wrote: > > On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote: > >> On Nov 16, 2015 5:37 PM, "Lisi Reisz" wrote: > >> > department has been trying for an hour". Puzzled, beca

Re: how execute a script

2015-11-17 Thread Elimar Riesebieter
* shawn wilson [2015-11-17 13:08 -0500]: > On Tue, Nov 17, 2015 at 1:02 PM, Chris Bannister > 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 da

Re: how execute a script

2015-11-17 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, Nov 18, 2015 at 07:02:01AM +1300, Chris Bannister wrote: > On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote: > > On Nov 16, 2015 5:37 PM, "Lisi Reisz" wrote: > > > department has been trying for an hour". Puzzled, because I though

Re: how execute a script

2015-11-17 Thread shawn wilson
On Tue, Nov 17, 2015 at 1:02 PM, Chris Bannister wrote: > On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote: >> On Nov 16, 2015 5:37 PM, "Lisi Reisz" wrote: >> > department has been trying for an hour". Puzzled, because I thought I had >> > sent a .pdf, and had checked that it opened

Re: how execute a script

2015-11-17 Thread Chris Bannister
On Tue, Nov 17, 2015 at 09:31:53AM -0500, shawn wilson wrote: > On Nov 16, 2015 5:37 PM, "Lisi Reisz" 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 ren

Re: how execute a script

2015-11-17 Thread shawn wilson
On Nov 16, 2015 5:37 PM, "Lisi Reisz" 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 David Wright > wrote: > > > > As for script-file extensions in DOS, there was really only .BAT > > > > was

Re: how execute a script

2015-11-17 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Nov 16, 2015 at 10:37:28PM +, 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 (p

Re: how execute a script

2015-11-17 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Nov 16, 2015 at 12:29:00PM -0600, David Wright wrote: [...] > > Whereas in UNIX, a file name is just a string: very few characters are > > special: steer clear of NUL and slash. If you want to have an easy life > > with shell scripts, steer c

Re: how execute a script

2015-11-16 Thread Lisi Reisz
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 David Wright wrote: > > > As for script-file extensions in DOS, there was really only .BAT > > > wasn't there?, so the idea of distinguishing .bash, .csh, .py,

Re: how execute a script

2015-11-16 Thread David Wright
On Mon 16 Nov 2015 at 06:54:40 (+0100), Martin Str|mberg wrote: > In article David Wright > 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 difficu

Re: how execute a script

2015-11-16 Thread David Wright
On Mon 16 Nov 2015 at 10:09:04 (+0100), to...@tuxteam.de wrote: > On Sun, Nov 15, 2015 at 10:47:13PM -0600, David Wright wrote: > > On Sat 14 Nov 2015 at 08:00:20 (+0100), to...@tuxteam.de wrote: > > > On Fri, Nov 13, 2015 at 09:11:34AM -0600, David Wright wrote: > > > > On Fri 13 Nov 2015 at 14:43

Re: how execute a script

2015-11-15 Thread Chris Bannister
On Mon, Nov 16, 2015 at 06:54:40AM +0100, Martin Str|mberg wrote: > In article David Wright > 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 diffi

Re: how execute a script

2015-11-15 Thread Martin Str|mberg
In article David Wright 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 tha

Re: how execute a script

2015-11-15 Thread David Wright
On Sat 14 Nov 2015 at 08:00:20 (+0100), to...@tuxteam.de wrote: > On Fri, Nov 13, 2015 at 09:11:34AM -0600, David Wright wrote: > > On Fri 13 Nov 2015 at 14:43:39 (+0100), to...@tuxteam.de wrote: > > > > > (as an aside: it's bad custom inherited from DOS to name shell scripts > > > with an .sh end

Re: how execute a script

2015-11-15 Thread shawn wilson
You can call a function from within a sourced file and it'll run (no matter x bit). So: # ~/bin/runner.sh runner () { echo foo } runner # ~/.bashrc PATH="$PATH:~/bin" source runner.sh On Nov 14, 2015 4:51 AM, "Pol Hallen" wrote: > Put the command at the end of /home/user/.profile >> It works

Re: how execute a script

2015-11-14 Thread Pol Hallen
Put the command at the end of /home/user/.profile It works for me. thanks for help but does not work :-/ Pol

Re: how execute a script

2015-11-13 Thread tomas
-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), to...@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

Re: how execute a script

2015-11-13 Thread Lotek
On 11/13/2015 06:43 AM, Pol Hallen wrote: (a) the result of the command "ls -l /home/user/bin/script1.sh" -rwx-- 1 user000 user000 936 Dec 5 2014 script1.sh my mistake sorry :-/ script1.sh checks (using apt-get update && apt-get upgrade) if there're (or not) any updates availables sh

Re: how execute a script

2015-11-13 Thread David Wright
On Fri 13 Nov 2015 at 16:08:07 (-0600), Don Armstrong wrote: > On Fri, 13 Nov 2015, David Wright wrote: > > The implementation isn't necessarily irrelevant when you have to > > maintain the scripts yourself. Just at the level of pressing F3 in mc, > > or running less, it saves time knowing what you

Re: how execute a script

2015-11-13 Thread Don Armstrong
On Fri, 13 Nov 2015, David Wright wrote: > The implementation isn't necessarily irrelevant when you have to > maintain the scripts yourself. Just at the level of pressing F3 in mc, > or running less, it saves time knowing what you expect to appear on > the screen. A good $EDITOR takes care of that

Re: how execute a script

2015-11-13 Thread David Wright
On Fri 13 Nov 2015 at 11:18:17 (-0600), Don Armstrong wrote: > On Fri, 13 Nov 2015, David Wright wrote: > > 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. Extensio

Re: how execute a script

2015-11-13 Thread Don Armstrong
On Fri, 13 Nov 2015, David Wright wrote: > 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

Re: how execute a script

2015-11-13 Thread David Wright
On Fri 13 Nov 2015 at 14:43:39 (+0100), to...@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/b

Re: how execute a script

2015-11-13 Thread Pol Hallen
(a) the result of the command "ls -l /home/user/bin/script1.sh" -rwx-- 1 user000 user000 936 Dec 5 2014 script1.sh my mistake sorry :-/ script1.sh checks (using apt-get update && apt-get upgrade) if there're (or not) any updates availables showing me only the total number of package

Re: how execute a script

2015-11-13 Thread Gene Heskett
On Friday 13 November 2015 08:50:25 Pol Hallen wrote: > Hi all :-) > > How can I execute a script inside a script? > > I putted inside /home/user/.bashrc a line like this: > > /home/user/bin/script1.sh > > but the script does not run... > > any idea? > Actually chmod +x script1.sh > thanks for he

Re: how execute a script

2015-11-13 Thread Gene Heskett
On Friday 13 November 2015 08:50:25 Pol Hallen wrote: > Hi all :-) > > How can I execute a script inside a script? > > I putted inside /home/user/.bashrc a line like this: > > /home/user/bin/script1.sh > > but the script does not run... > > any idea? > chmod +x? > thanks for help! :-) > > Pol C

Re: how execute a script

2015-11-13 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, Nov 13, 2015 at 02:50:25PM +0100, Pol Hallen wrote: > Hi all :-) > > How can I execute a script inside a script? > > I putted inside /home/user/.bashrc a line like this: > > /home/user/bin/script1.sh > > but the script does not run... > >

Re: how execute a script

2015-11-13 Thread Darac Marjal
On Fri, Nov 13, 2015 at 02:50:25PM +0100, Pol Hallen wrote: Hi all :-) How can I execute a script inside a script? I putted inside /home/user/.bashrc a line like this: /home/user/bin/script1.sh but the script does not run... What is your evidence for the statement that it "does not run"? A

how execute a script

2015-11-13 Thread Pol Hallen
Hi all :-) How can I execute a script inside a script? I putted inside /home/user/.bashrc a line like this: /home/user/bin/script1.sh but the script does not run... any idea? thanks for help! :-) Pol