[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Directs makeinfo and texi2html output to logfiles (issue 5645046)
From: |
Julien Rioux |
Subject: |
Re: Directs makeinfo and texi2html output to logfiles (issue 5645046) |
Date: |
Wed, 8 Feb 2012 15:28:42 +0100 |
On Wed, Feb 8, 2012 at 3:05 PM, Phil Holmes <address@hidden> wrote:
> ----- Original Message ----- From: "Julien Rioux" <address@hidden>
> To: "Phil Holmes" <address@hidden>
>
>> Yes, the DEPTH=... confuses bash, so eval is needed. Please try
>> something like the attached though. It removes all the exec stuff and
>> will be much easier to understand for future contributors. The exec
>> stuff is needed only for complex redirection, for example if you
>> wanted stderr to appear both on the terminal and in the log file. But
>> currently we just redirect both stdout and stderr to the log file, and
>> this scenario does not need complex exec stuff.
>>
>> Regards,
>> Julien
>
>
> eval $1 >& $2
>
> gives:
>
> ./new-run-check.sh: 2: Syntax error: Bad fd number - finger trouble on the
> redirect. eval $1 &> $2 simply doesn't redirect the output - it appears on
> the terminal and no logfile is created. I spent quite a long time a few
> weeks ago getting this to work and was surprised it didn't, but convinced
> myself that the way I arrived at is pretty much the only solution. I
> understand what you say about maintainability, but I've commented it quite a
> bit and the script could just be removed if it was too confusing, so I'm not
> convinced it's worth too much time repeating what I did earlier to try to
> get this to work.
>
> --
> Phil Holmes
>
I guess I made a typo and it should be
eval $1 &> $2 # Redirect both stdout and stderr
to log file.
but apparently my version of bash understands either &> or >&, and it
works perfectly:
$ ./run.sh "DEPTH=../.. ls run.sh x" mylogfile
An error occured. Please check the logfile mylogfile
$ cat mylogfile
ls: cannot access x: No such file or directory
run.sh
Are you sure you run the script with bash? What do you get from bash
--version? I have bash --version
GNU bash, version 4.1.10(1)-release (x86_64-suse-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Cheers,
Julien
- Re: Directs makeinfo and texi2html output to logfiles (issue 5645046), (continued)
Re: Directs makeinfo and texi2html output to logfiles (issue 5645046), julien . rioux, 2012/02/08
- Re: Directs makeinfo and texi2html output to logfiles (issue 5645046), Phil Holmes, 2012/02/08
- Re: Directs makeinfo and texi2html output to logfiles (issue 5645046), Julien Rioux, 2012/02/08
- Re: Directs makeinfo and texi2html output to logfiles (issue 5645046), Phil Holmes, 2012/02/08
- Re: Directs makeinfo and texi2html output to logfiles (issue 5645046), David Kastrup, 2012/02/08
- Re: Directs makeinfo and texi2html output to logfiles (issue 5645046),
Julien Rioux <=
- Re: Directs makeinfo and texi2html output to logfiles (issue 5645046), David Kastrup, 2012/02/08
- Re: Directs makeinfo and texi2html output to logfiles (issue 5645046), Julien Rioux, 2012/02/08
- Re: Directs makeinfo and texi2html output to logfiles (issue 5645046), Phil Holmes, 2012/02/08
Re: Directs makeinfo and texi2html output to logfiles (issue 5645046), David Kastrup, 2012/02/08
Re: Directs makeinfo and texi2html output to logfiles (issue 5645046), julien . rioux, 2012/02/08