4 ms·
RTFM, from `man base64`: -w, --wrap=COLS wrap encoded lines after COLS character (default 76). Use 0 to disable line wrapping The manpage is about one
by blueflow 3y ago
RTFM, from `man base64`:
-w, --wrap=COLS
wrap encoded lines after COLS character (default 76). Use 0 to disable line wrapping
The manpage is about one screen size large. 1 minute read.
- echoangle 3y agoSure, but it’s still a bad default IMO, the expected behavior would be an unformatted string without any linebreaks
- deleted 3y ago[deleted]
- oniony 3y agoSo you pass in a 1gig binary you want a very, very long line of text that many text editors would choke on? The purpose of base64 is to turn binary into text that can be embedded in normal text messages such as email and Usenet. A right margin of about 80 characters is very much what one should expect such a tool to default to.
- scrollaway 3y agoIf you're passing a 1GB binary to base64 you're ... incredibly unlikely to be dealing with the resulting base64 manually (copypaste, text editor, whatever). So, yes, the expected default would still be no linebreaks. The primary purpose of these tools have changed over time as the environment has changed. You know nobody uses usenet anymore, and nobody copypastes base64 into emails anymore, right?
- blueflow 3y agoThe default will not be changed because it breaks the original use cases. Which some people still have even if you do not.
- PinguTS 3y agoFor old farts like me who used to use News groups where binary data was first encoded in uuencode and later with the innovative base64, it is totally expected behavior. Also look into the text files für the public/private keys. It is always this, because the screen has only 80 characters in width.
- sunaookami 3y agoIMHO this is completely unexpected behaviour and why would you read the manual if you don't expect this? base64 is not a difficult program to use. I certainly don't read the manual for every command that just takes an input - like sha256sum etc.
- deleted 3y ago[deleted]
- secondcoming 3y agoRight, but it seems they did RTFM once they discovered this quirk in the behaviour of the command.
- saurik 3y agoMaybe it would behoove people to read the manual before they "discover a quirk"? I always at least give the manual a good skim before running the command at all...
- Zambyte 3y agoThis surely isn't the first time they've run the base64 command. If they have used it before, I wouldn't expect them to read the manual again unless they are trying to get different behavior out of the tool. Instead they had to read it again to get the same behavior out of the tool
- blueflow 3y agoHow did they figure out to use the tool in the first place? Copied from Stackoverflow? Guessed?
- Zambyte 3y agoI can't answer that because I'm not them, but maybe man...? My point is that: - base64 is a stupid easy command to use the default behavior (guessing is easily possible) - they probably would not have retained flags from the man page unless they needed to use them the first time they used base64 - they probably didn't need to use any flags with base64 in the past - it's perfectly reasonable to expect base64 to base64 long inputs the same way it encodes short ones. In fact I would say any other suggestion is unreasonable - it is perfectly reasonable to not read the man page again when you have a concrete expectation of how a program should behave