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
; >> 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 (n

Re: how execute a script

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

Re: how execute a script

2015-11-17 Thread John Hasler
ention that it's in AT&T Unix since 1979. I'd venture to > say that nowadays it is an integral part of Unix. In fact the shebang in ASCII is the magic number for a shell script. I think that the relevant standard would be the SUS. -- John Hasler jhas...@newsguy.com Elmwood, WI USA

Re: how execute a script

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

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

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
ts 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 loo

Re: how execute a script

2015-11-17 Thread shawn wilson
magic dropped the ball - should've been identified as a shell script (due to the use of "echo"

Re: how execute a script

2015-11-17 Thread David Wright
7;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 fo

Re: how execute a script

2015-11-17 Thread shawn wilson
te 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) shoul

Re: how execute a script

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

Re: how execute a script

2015-11-17 Thread Brian
ension). 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 ex

Re: how execute a script

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

Re: how execute a script

2015-11-17 Thread shawn wilson
;> 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.p

Re: how execute a script

2015-11-17 Thread Brian
n, 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 argumen

Re: how execute a script

2015-11-17 Thread Elimar Riesebieter
he 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

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

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

Re: how execute a script

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

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

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 a

Re: how execute a script

2015-11-16 Thread David Wright
n, > > say, DOS/360 etc), > > I guess that comes from CP/M, DOS being a cheap ripoff therefrom. But > that's more or less the horizon of my memories. > > >going back to the origins of unix and further. > > Unix? File Extensions? -- Citation nee

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 a

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

Re: how execute a script

2015-11-15 Thread David Wright
checkfs.sh* > > [...] > > Very smart. I didn't say the scripts are inherited from DOS. That bad > habit is, definitely. Well file extensions in general are of course much older than DOS (assuming you mean MSDOS-compatible rather than the old meaning as in, say, DOS/360 etc), goi

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

Re: how execute a script

2015-11-13 Thread Lotek
any updates availables showing me only the total number of packages, so inside /home/user/.bashrc, exactly I've: /home/user/bin/script1.sh & Put the command at the end of ".profile". It works for me. Lotek the problem is "&" because without it script d

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
nly the total number of packages, so inside /home/user/.bashrc, exactly I've: /home/user/bin/script1.sh & the problem is "&" because without it script does run after executing of script, output goes to shell with "| wall" thanks Pol

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? > Actual

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

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

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 no

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

re: Networking performance script

2015-10-19 Thread Michael Jones
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi, I've written a new script to promote the correct use of kernel options and queue disciplines for improving network performance in Linux. I'm keen for feeback technical or not. https://github.com/mikejonesey/net-check Kind Reg

Re: bash script globbing

2015-09-20 Thread rlharris
le in order to change the margins and customize headings; that I why I ended up putting the customization into a bash script "enscript+". However, just now, when I executed "enscript *" on a directory of files, to see whether the unmodified package could handle globs, all of the

Re: bash script globbing

2015-09-20 Thread Thomas Schmitt
only the first > file in the directory. This is because you use only the first argument "$1" in your script. The globbing happens before your script gets started. The shell parser converts your command enscript+ * to a list of arguments enscript+ file1 file2 ... which your script gets

Re: bash script globbing

2015-09-20 Thread Loïc Grenié
2015-09-20 22:20 GMT+02:00 : > I have been using the following script (named "enscript+") as a substitute > for the package "a2ps": > > #!/bin/bash > enscript --media=letter -2 --landscape --borders \ > --header='$n|A.D. $D{%Y.%m.%d}|$* gmt |

bash script globbing

2015-09-20 Thread rlharris
I have been using the following script (named "enscript+") as a substitute for the package "a2ps": #!/bin/bash enscript --media=letter -2 --landscape --borders \ --header='$n|A.D. $D{%Y.%m.%d}|$* gmt | Page $% of $=' "$1" The script works p

Re: java script error in iceweasel

2015-08-29 Thread Francesco Ariis
On Fri, Aug 28, 2015 at 06:47:03AM -0500, Harold M. Meneley wrote: > Hi, I just tried using Jessie with the new Iceweasel. I went to several > web sites that worked before and I can't seem to get the java scripts > associated with buttons to work. I tried installing java, openjdk and > icedtea with

java script error in iceweasel

2015-08-29 Thread Harold M. Meneley
Hi, I just tried using Jessie with the new Iceweasel. I went to several web sites that worked before and I can't seem to get the java scripts associated with buttons to work. I tried installing java, openjdk and icedtea with no results. Can't supply anymore information other than clean install of J

Re: systemd vs sysvinit: init script arguments

2015-08-22 Thread Jonathan de Boyne Pollard
Stuart Longland: > I've used the OpenVPN init script as a template for creating my init scripts, [...] And that's the point at which you went wrong. OpenVPN was one of the earliest things converted to systemd with its service management set up very differently to the way that

Re: systemd vs sysvinit: init script arguments

2015-08-21 Thread Michael Biebl
Hi Stuart, Am 20.08.2015 um 23:48 schrieb Stuart Longland: > I've used the OpenVPN init script as a template for creating my init > scripts, which allows me to not only start and stop all drivers, but > also start or stop an individual driver. e.g. > > /etc/init.d/

Re: systemd vs sysvinit: init script arguments

2015-08-21 Thread Darac Marjal
ata > interface for trending and analysis. Basically the data-gathering > guts of a SCADA system. > > The system is built on the Unix philosophy, so each communications > driver and service runs as a separate process, communicating over > AMQP. So far so good. > > I'v

systemd vs sysvinit: init script arguments

2015-08-20 Thread Stuart Longland
ically the data-gathering guts of a SCADA system. The system is built on the Unix philosophy, so each communications driver and service runs as a separate process, communicating over AMQP. So far so good. I've used the OpenVPN init script as a template for creating my init scripts, which allows

Re: I made a thing: APT update notifier script for xfce4-genmon-plugin

2015-07-19 Thread Enno Weichert
And already goofed up. I thought I had tested it but I guess not. The attached version doesn't work if there are no updates. The current version is on Github: https://gist.github.com/weichert/4931be14cc93443ad74f -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject o

I made a thing: APT update notifier script for xfce4-genmon-plugin

2015-07-19 Thread Enno Weichert
Hi, since there isn't an update-notifier for the XFCE panel anymore and pk-update-icon isn't in Jessie and apparently has large dependencies to build as of yet, this is a small script to do just that. It uses xfce4-genmon-plugin (or actually it's the other way around). Do

Re: Debugging a LSB init script under systemd

2015-07-09 Thread Stuart Longland
Hi Reco, On 09/07/15 16:43, Reco wrote: >> > Is there a way to tell systemd to LEAVE the script alone while I debug >> > it and get it working? > Yes. Setting _SYSTEMCTL_SKIP_REDIRECT environment variable to any value > should allow you to run it directly. Ahh, that

Re: Debugging a LSB init script under systemd

2015-07-09 Thread Reco
Hi. On Thu, 09 Jul 2015 14:37:52 +1000 Stuart Longland wrote: > Hi all, > > Is there any way to debug a LSB init script under systemd? I'm trying > to write an init script for a service that starts multiple daemons, much > like OpenVPN and how it starts a separate daemon

Debugging a LSB init script under systemd

2015-07-08 Thread Stuart Longland
Hi all, Is there any way to debug a LSB init script under systemd? I'm trying to write an init script for a service that starts multiple daemons, much like OpenVPN and how it starts a separate daemon for each connection. So I've taken the OpenVPN init script and hacked it to make it

Re: Bash script calling python script fails

2015-06-17 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, Jun 17, 2015 at 08:16:29AM +0200, rudu wrote: > Le 16/06/2015 17:38, rudu a écrit : [...] > When launched from the symlink, this code set the working directory > to if-up.d where no python script was to be found. > My bad, but

Re: Bash script calling python script fails

2015-06-16 Thread rudu
. I overlooked some piece of code I thought was of no consequence ... but it was : EXEDIR=$(dirname $0) echo $EXEDIR cd "${EXEDIR}" When launched from the symlink, this code set the working directory to if-up.d where no python script was to be found. My bad, but thanks a lot to Tomas

Re: Bash script calling python script fails

2015-06-16 Thread rudu
can't figure out : [...] Thank you Tomas, You're right I should have pasted my script in the first place (see below). By the way, you'll see I already thought about this $PATH thing, but unless I forgot something that doesn't seem to be the case here. So, briefly said, that lin

Re: Bash script calling python script fails

2015-06-16 Thread tomas
igure out : [...] > Thank you Tomas, > You're right I should have pasted my script in the first place (see below). > By the way, you'll see I already thought about this $PATH thing, but > unless I forgot something that doesn't seem to be the case here. > So, briefly

Re: Bash script calling python script fails

2015-06-16 Thread rudu
Le 16/06/2015 12:47, to...@tuxteam.de a écrit : On Tue, Jun 16, 2015 at 11:23:51AM +0200, rudu wrote: Hello, There's something I just can't figure out : I wrote a bash script to compare my actual IP address to the one of my DynDNS service provider. That bash script calls a pyt

Re: Bash script calling python script fails

2015-06-16 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tue, Jun 16, 2015 at 11:23:51AM +0200, rudu wrote: > Hello, > There's something I just can't figure out : > I wrote a bash script to compare my actual IP address to the one of > my DynDNS service provider. > That bash scr

Bash script calling python script fails

2015-06-16 Thread rudu
Hello, There's something I just can't figure out : I wrote a bash script to compare my actual IP address to the one of my DynDNS service provider. That bash script calls a python script (provided by the DynDNS service) to update my DynDNS Address if necessary. Everything runs smoot

Re: (script) Re: Rediscovering a forgotten command

2015-05-09 Thread Richard Owlett
documentation implied it had originally been targeted at classroom environment. Can anyone identify this? script, but I find it quite useful to have a bash function defined as scrip () { script typescript-${HOSTNAME}-$(date +%Y-%m-%d-%H-%M-%S)-$1 } so that you get a host/timestamp in the

(script) Re: Rediscovering a forgotten command

2015-05-09 Thread David Wright
ocumentation implied it had > originally been targeted at classroom environment. > > Can anyone identify this? script, but I find it quite useful to have a bash function defined as scrip () { script typescript-${HOSTNAME}-$(date +%Y-%m-%d-%H-%M-%S)-$1 } so that you get a host/ti

Re: Insert a script into systemd boot order at a specific location

2015-03-16 Thread Michael Biebl
an.org helped me further: I do > not have to change anything, just calling update-rc.d for my init script > works, just like it did before in wheezy. I had read that systemd supports > LSB init scripts, but i did not expect that this compatibility goes so > far. > > But there is s

Re: Insert a script into systemd boot order at a specific location

2015-03-16 Thread Christoph Pleger
.d for my init script works, just like it did before in wheezy. I had read that systemd supports LSB init scripts, but i did not expect that this compatibility goes so far. But there is still one problem: The output of my script is not displayed on the screen. Regards Christoph -- To UNSUBSCRI

Re: Insert a script into systemd boot order at a specific location

2015-03-13 Thread Michael Biebl
. Then, I rebooted again and the result was the same as before. Why does systemd not follow these instructions that my script has to be executed before multi-user? You are starting your service as part of multi-user.target, so you can't order it before it at the same time. Also, targets

Re: Insert a script into systemd boot order at a specific location

2015-03-13 Thread David Wright
wouldn't do that). [...] > Then, I called systemctl to set the correct symlinks for script.target and > script.service. > > Then, I rebooted again and the result was the same as before. > > Why does systemd not follow these instructions that my script has to be > executed b

Re: Insert a script into systemd boot order at a specific location

2015-03-13 Thread Christoph Pleger
fter=" units also in "Requires=" so that starting your unit > causes the "After=" units to be started too (but, presumably, if they're > optional, you wouldn't do that). As a first attempt, I created a file /lib/systemd/system/script.service, looking lik

Re: Insert a script into systemd boot order at a specific location

2015-03-13 Thread Darac Marjal
On Fri, Mar 13, 2015 at 09:20:53AM +0100, Christoph Pleger wrote: > Hello, > > for many years and up to Debian 7, I am using update-rc.d to define a > specific location in the boot order, where a script is executed which > automatically performs some administrative tasks. The scr

Insert a script into systemd boot order at a specific location

2015-03-13 Thread Christoph Pleger
Hello, for many years and up to Debian 7, I am using update-rc.d to define a specific location in the boot order, where a script is executed which automatically performs some administrative tasks. The script is executed after only very basic tasks have been performed, and before all other tasks

Re: Script to email details not working in cron

2015-01-03 Thread Bob Proulx
Sven Hartge wrote: > You don't need the manually invoke /bin/bash if you just add > "#!/bin/bash" as the first line of your shell script, which Don already > pointed out: > >> 3) It may not be executable. Yes. Make sure it is executable. chmod a+x /hom

Re: Script to email details not working in cron

2015-01-03 Thread Sven Hartge
Manikandan M wrote: > I couldn't find why the script is not working in cron. Just replaced the > crontab entry with the following and it worked > * 9 * * * /bin/bash /user/bin/email-script This will run the script _every minute_ on the ninth hour. I don't think this is w

Re: Script to email details not working in cron

2015-01-03 Thread Manikandan M
Hi, I couldn't find why the script is not working in cron. Just replaced the crontab entry with the following and it worked * 9 * * * /bin/bash /user/bin/email-script Thanks everyone for your help. Regards, Mani On Fri, Jan 2, 2015 at 9:13 PM, Don Armstrong wrote: > On Fri, 02

Re: Script to email details not working in cron

2015-01-02 Thread Don Armstrong
On Fri, 02 Jan 2015, Manikandan M wrote: > I have written a small script to email (using ssmpt) some details, and > scheduled it in crontab. The script is running as per time mentioned in the > cron but ssmtp is not sending the mail. please find the details below. > > user@host ~

Re: Script to email details not working in cron

2015-01-02 Thread Bob Proulx
Manikandan M wrote: > I have written a small script to email (using ssmpt) some details, and > scheduled it in crontab. The script is running as per time mentioned in the > cron but ssmtp is not sending the mail. please find the details below. A couple of details to provide back

Re: Script to email details not working in cron

2015-01-02 Thread Emil Oppeln-Bronikowski
On Fri, Jan 02, 2015 at 06:39:27PM +, Manikandan M wrote: Are other scripts running fine? Can you throw a silly date >>/tmp/imalive into it and see? Does ssmtp (I'm unfamilar with it) requies some special env-var that can be unset when running from Cron? -- People are like potatos. They d

Re: Script to email details not working in cron

2015-01-02 Thread Manikandan M
Thanks for the quick response Patrick. I have given the full path for all the executables in the script. Still i'm not getting the email. The first line of the script works which updates the details-file. The third line of the script works which updates the status of the email operation. Bot

Re: Script to email details not working in cron

2015-01-02 Thread Patrick Wiseman
On Fri, Jan 2, 2015 at 1:39 PM, Manikandan M wrote: > Hi, > > I have written a small script to email (using ssmpt) some details, and > scheduled it in crontab. The script is running as per time mentioned in the > cron but ssmtp is not sending the mail. please find the details below

Script to email details not working in cron

2015-01-02 Thread Manikandan M
Hi, I have written a small script to email (using ssmpt) some details, and scheduled it in crontab. The script is running as per time mentioned in the cron but ssmtp is not sending the mail. please find the details below. user@host ~ $ cat bin/email-script /home/user/bin/actual-script

Re: shell script removing log files.

2014-12-22 Thread Andrei POPESCU
On Lu, 22 dec 14, 10:51:26, pe...@easthope.ca wrote: > This command in a shell script removes unwanted log files. > > for i in $( echo *.Log ); do > /bin/rm $i; > echo "Removed $i." > done > > In the edge case of no matching files, rm complains. > /b

Re: shell script removing log files.

2014-12-22 Thread Karl E. Jorgensen
On Mon, Dec 22, 2014 at 10:51:26AM -0800, pe...@easthope.ca wrote: > This command in a shell script removes unwanted log files. > > for i in $( echo *.Log ); do > /bin/rm $i; > echo "Removed $i." > done > > In the edge case of no matching files, rm c

Re: init script can't find /bin/dirname

2014-12-22 Thread Sven Joachim
On 2014-12-22 19:23 +0100, Rob Owens wrote: > $ ls -l /bin/dirname > -rwxr-xr-x 1 root root 13880 Jan 30 2007 /bin/dirname > > $ file /bin/dirname > dirname: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), > dynamically linked (uses shared libs), for GNU/Linux 2.4.1, stripped > > Simila

Re: shell script removing log files.

2014-12-22 Thread Jerome BENOIT
On 22/12/14 19:51, pe...@easthope.ca wrote: > This command in a shell script removes unwanted log files. > > for i in $( echo *.Log ); do > /bin/rm $i; > echo "Removed $i." > done > > In the edge case of no matching files, rm complains. > /bin/rm: c

Re: shell script removing log files.

2014-12-22 Thread The Wanderer
On 12/22/2014 at 01:51 PM, pe...@easthope.ca wrote: > This command in a shell script removes unwanted log files. > > for i in $( echo *.Log ); do > /bin/rm $i; > echo "Removed $i." > done > > In the edge case of no matching files, rm complains. > /b

shell script removing log files.

2014-12-22 Thread peter
This command in a shell script removes unwanted log files. for i in $( echo *.Log ); do /bin/rm $i; echo "Removed $i." done In the edge case of no matching files, rm complains. /bin/rm: cannot remove `*.Log': No such file or directory If echo is replaced with ls, it compl

Re: init script can't find /bin/dirname

2014-12-22 Thread Rob Owens
On Mon, Dec 22, 2014 at 10:55:15AM -0500, Rob Owens wrote: > On Mon, Dec 22, 2014 at 04:41:05PM +0100, Sven Joachim wrote: > > On 2014-12-22 04:10 +0100, Rob Owens wrote: > > > So I'm still not sure why /etc/init.d/mysql cannot find "dirname" and > > > "basename" when running at system boot, but it

Re: init script can't find /bin/dirname

2014-12-22 Thread Rob Owens
On Mon, Dec 22, 2014 at 04:41:05PM +0100, Sven Joachim wrote: > On 2014-12-22 04:10 +0100, Rob Owens wrote: > > So I'm still not sure why /etc/init.d/mysql cannot find "dirname" and > > "basename" when running at system boot, but it can find them when run > > from a terminal after boot. > > Maybe

Re: init script can't find /bin/dirname

2014-12-22 Thread Sven Joachim
On 2014-12-22 04:10 +0100, Rob Owens wrote: > I rebooted and found that the path is fine: > > /sbin:/usr/sbin:/bin:/usr/bin A notable difference to the default PATH of a logged in user (with the standard /etc/profile, anyway) is that init places /bin before /usr/bin. > So I'm still not sure why

Re: init script can't find /bin/dirname

2014-12-21 Thread Rob Owens
On Sun, Dec 21, 2014 at 06:07:20PM -0500, Rob Owens wrote: > On Sun, Dec 21, 2014 at 10:32:07PM +0100, Sven Joachim wrote: > > On 2014-12-21 21:58 +0100, Rob Owens wrote: > > > I know I could add a PATH statement to the init script, but this problem > > > is my own d

Re: init script can't find /bin/dirname

2014-12-21 Thread Rob Owens
On Sun, Dec 21, 2014 at 10:32:07PM +0100, Sven Joachim wrote: > On 2014-12-21 21:58 +0100, Rob Owens wrote: > > > The /etc/init.d/mysql script on one of my systems is complaning that it > > can't find /bin/dirname and /bin/basename. Line 24 of the script is > > this

Re: init script can't find /bin/dirname

2014-12-21 Thread Sven Joachim
On 2014-12-21 21:58 +0100, Rob Owens wrote: > The /etc/init.d/mysql script on one of my systems is complaning that it > can't find /bin/dirname and /bin/basename. Line 24 of the script is > this: > > SELF=$(cd $(dirname $0); pwd -P)/$(basename $0) > > Both dirname and

init script can't find /bin/dirname

2014-12-21 Thread Rob Owens
The /etc/init.d/mysql script on one of my systems is complaning that it can't find /bin/dirname and /bin/basename. Line 24 of the script is this: SELF=$(cd $(dirname $0); pwd -P)/$(basename $0) Both dirname and basename live in /usr/bin, not /bin. I know I could add a PATH statement t

<    4   5   6   7   8   9   10   11   12   13   >