On 17/06/2011, [email protected] <[email protected]> wrote: > Send coreutils mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.gnu.org/mailman/listinfo/coreutils > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of coreutils digest..." > > > Today's Topics: > > 1. Re: base64 terminal input failure (Davide Brini) > 2. Re: [PATCH] tests: use printf, not echo in init.sh's warn_ > function (Jim Meyering) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 17 Jun 2011 14:18:45 +0200 > From: Davide Brini <[email protected]> > To: [email protected] > Subject: Re: base64 terminal input failure > Message-ID: <[email protected]> > Content-Type: text/plain; charset=UTF-8 > > On Fri, 17 Jun 2011 09:38:07 +0100 > e-letter <[email protected]> wrote: > >> On 17/06/2011, Bob Proulx <[email protected]> wrote: >> > e-letter wrote: >> >> I have tried to copy base64 encoded text from the clipboard (i.e. a >> >> web mail message) to the command terminal: >> >> >> >> base64 -d 'xyz' >> >> >> >> where 'xyz' is the base64 text. According to the manual, standard >> >> input can be accepted if a file is not accepted but instead the >> >> terminal response is: >> >> >> >> base64: xyz: No such file or directory >> >> >> >> What is my mistake please? >> > >> > The base64 syntax is: >> > >> > base64 [OPTION]... [FILE] >> > >> > You have specified one option and what appears to the command to be >> > one file. The -d fits in the [OPTION] spot and the xyz fits in the >> > [FILE] spot. >> > >> > The brackets indicate that those parts are optional. For [OPTIONS] no >> > options means to encode. Specifying -d means to decode. >> > >> > For [FILE] this means that if a file is specified then the command >> > will open the file and read it. If no file is specified on the >> > command line then it will read standard input. >> > >> >> The command: >> >> 'echo xyz | base64 -d' >> >> >> >> returns: >> >> ?,base64: invalid input >> >> >> >> If the base64 text is saved as a file, conversion is successful. >> > >> > This is because "xyz" isn't valid base64 encoded data. It works >> > successfully if you give it valid input data instead of random >> > characters. See this example: >> > >> >> I wrote 'xyz' not as literal, verbatim encoded text but as an example. >> Repeating this as follows causes the same error: >> >> ...@localhost ~]$ base64 -d Zm9vCg== >> base64: Zm9vCg==: No such file or directory > > Which part of > > base64 [OPTION]... [FILE] > > is not clear? > isn't option '-d' not correct?
Therefore the syntax seems base64 -d ... If no file is to be specified then it seems logical to add the base64 encoded text where the ellipsis are shown above.
