Re: Variable passed to system contains garbage characters

2007-12-17 Thread Patrick Nagelschmidt
At 17.12.2007, Bob Proulx wrote: Patrick Nagelschmidt wrote: > The script below fails on my box with the following output: > > 1197676800 > date: invalid date `1970-01-01 \033[?1034h1197676800 sec' > > So for some reason the value passed to date got a nasty prefix.

Re: Variable passed to system contains garbage characters

2007-12-17 Thread Chet Ramey
Andreas Schwab wrote: > Patrick Nagelschmidt <[EMAIL PROTECTED]> writes: > >> ++ echo '1197919330 - (1197919330 % 86400) - 86400' >> ++ bc -i > > This is bogus. Why are you forcing bc in interactive mode? I'm assuming this is the problem, since bc -i uses readline, and the bogus sequence looks

Re: Variable passed to system contains garbage characters

2007-12-17 Thread Bob Proulx
Patrick Nagelschmidt wrote: > The script below fails on my box with the following output: > > 1197676800 > date: invalid date `1970-01-01 \033[?1034h1197676800 sec' > > So for some reason the value passed to date got a nasty prefix. I cannot recreate the problem.

Re: Variable passed to system contains garbage characters

2007-12-17 Thread Andreas Schwab
Patrick Nagelschmidt <[EMAIL PROTECTED]> writes: > ++ echo '1197919330 - (1197919330 % 86400) - 86400' > ++ bc -i This is bogus. Why are you forcing bc in interactive mode? Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germ

Re: Variable passed to system contains garbage characters

2007-12-17 Thread Patrick Nagelschmidt
At 17.12.2007, Chet Ramey wrote: I can't reproduce this on fedora core 6, which is the closest Linux box. I suspect this is prompt string or PROMPT_COMMAND related, so a transcript of running this script with `bash -x' would help. No problem: $ bash -x "./test.sh" + alias 'scr=screen -R ' + '

Re: Variable passed to system contains garbage characters

2007-12-17 Thread Chet Ramey
Patrick Nagelschmidt wrote: > Machine Type: i686-redhat-linux-gnu > > Bash Version: 3.2 > Patch Level: 33 > Release Status: release > > Description: > The script below fails on my box with the following output: > > 1197676800 > date: invalid date `1970-01-01 \033[?1034h11

Variable passed to system contains garbage characters

2007-12-17 Thread Patrick Nagelschmidt
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DP