[PLUG] bash vs dash and the "at" command

frankhunt fh-linux at frankhunt.com
Mon Oct 25 19:00:48 UTC 2010


I finally actually read the first part of the man page for at and found 
the reference to /bin/sh.
Duh.
I'll give the single line that calls the real script a try . . .
thanks.


On 10/25/2010 11:53 AM, chris (fool) mccraw wrote:
> On Mon, Oct 25, 2010 at 11:27, frankhunt<fh-linux at frankhunt.com>  wrote:
>> Does the "at" scheduler use bash or dash?
> mine (ubuntu 10.4 still) uses /bin/sh as documented in the first line
> of the at(1) man page.  on my system, /bin/sh is linked to dash rather
> than bash.  i believe there have been other conversations on here
> about relinking /bin/sh to bash and how it breaks things, so that's
> probably not a good fix.  plus, when run as 'sh', bash behaves like
> its slower older brother posix bourne shell--see
> http://www.gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html.
>
>
Ideas??

> a fine point of at(1) job submission that i just discovered from the
> same man page, is that if you submit a file, it is treated as a list
> of commands, run via /bin/sh.  if you submit from standard in, it will
> instead just run the command, which if it is a script will obey your
> opening shebang line.  i just tested that and it works fine (run: at
> now +4 hours, type in the path to your script, hit control d, or just
> "echo /path/to/script | at now +4 hours).  you can put the calculated
> time specification into the command line that runs at, rather than in
> the script itself, maybe?  i'd use expr(1) with date(1) to do it
> rather than the shell builtin 'let'.  you could use date +%s to grab
> number of seconds since the epoch as a source of a number that won't
> be the same twice (unless you execute your script twice in one
> second).
>
> i guess another workaround is to submit a file that just has one line
> that runs the other script (with the bash-specific shell functions in,
> starting with #!/bin/bash), if you really must submit a file rather
> than using stdin.
>
> luck++;
>

-- 
frank hunt
(L0F) R0B-ZAR1
befuddled linux admin
erstwhile photographer
hillsboro oregon




More information about the PLUG mailing list