[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Can't redirect stout and stderr



Nicolas George <george@nsup.org> writes:

> Le sextidi 6 floréal, an CCXXIII, Rodolfo Medina a écrit :
>> My old pc has corrupt filesystem problems, and, in order to ask the present
>> list some help about that, I need to store to a file the output of
>> `update-grub', both stdout and stderr, but don't manage to even using any of
>> the solutions suggested wherever I could find them: nor `update-grub > file'
>> nor `update-grub &> file' neither `update-grub > file 2&1'.
>
> Please be more precise: with the information you have given, it is
> impossible to guess WHY it is failing: maybe a typo in your command-line,
> maybe permissions problems, maybe read-only filesystem.
>
> Read the error message. If you do not understand it, copy it as carefully as
> possible (copy-paste if you can) here 
>
> "&> file" is a bashism but should work.
>
> "> file 2&1" is a typo for "> file 2>&1"


Both commands write onto `file' only a part of the output of `update-grub', I
think the standard output.  After giving the command and pressing `enter', that
part is not shown on the screen but sent to `file'.  The `error' part instead
(the one complaining `unable to read superblock' and so on) is not written to
`file' but is shown after giving the command and pressing `enter', and I don't
manage to send it to a file.

Thanks,

Rodolfo


Reply to: