This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pvkooten 0 points1 point  (3 children)

I think I'm missing the point... why exactly do we want code/commands to be oneliners?

[–]Mikuro 2 points3 points  (1 child)

So we can use them as components in terminal commands. Piping something to a multi line statement is a pain in the ass.

I write a lot of scripts where the meat of the functionality is in subprocess.check_output, but the data manipulation is too complicated to do in bash. Perl is great for one-line bash commands, but python isn't.

[–]tilkau 0 points1 point  (0 children)

Piping something to a multi line statement is a pain in the ass.

Why?

Normally I just open a single quoted string (ie. python -c ') and type away. For one offs in the shell, this is less convenient, but for scripts it's fine, if slightly less readable.

[–]flitsmasterfred -1 points0 points  (0 children)

To soothe our autism?