Vote Up
4
Votes
Vote Down

Ever wanted to order a pizza via the command line? Me neither.

Watch as they spend the majority of the video explaining the flags for onions, green peppers, etc. Notice that quantity is it’s own flag, meaning that no matter how many pizzas you order, they all must have the same toppings.

I could waste a lot of time typing out an outrageously long command OR I could just use the instantly discoverable online ordering system that presents a friendly form to fill out that I don’t have to debug for syntax errors.

#1 Posted by ChrisTX on Apr 27, 2011 8:29 PM

Oh, I’ve seen that before. Try to watch the video without laughing at the guy who recorded it. I for one can’t.

#2 Posted by Adam_King on Apr 27, 2011 8:40 PM

Yeah you go ahead and use the unintuitive and slow online ordering system.

This is just one example of why GNU/Linux is awesome.

#3 Posted by Chlorus on Apr 27, 2011 9:42 PM

And those flags are intuitive, right Adam? I doubt you actually use Linux, you’re probably some troll account cooked up by DrLoser or something to further discredit the freetards.

#4 Posted by administrator on Apr 27, 2011 10:16 PM

Adam, let’s see you order a pizza using the CLI without the manual.

#5 Posted by Adam_King on Apr 27, 2011 10:23 PM

So what. You only have to read it once. You can alias your fav pizzas to things like “gimme_a_mushroom_pizza_plz” or something. I’m sure some of you didn’t even know that was a possibility.

#6 Posted by reactosguy on Apr 27, 2011 10:25 PM

Or, you can buy a pizza from Microsoft Chefs for a few dollars on your credit card.

That’s the inferiority of GNU/Linux. It needs improvement.

#7 Posted by bassboy on Apr 28, 2011 12:10 AM

Yeah you go ahead and use the unintuitive and slow online ordering system.

This is just one example of why GNU/Linux is awesome

Exactly. What if you order a pizza or two everyday? What if you want different configurations for your pizza for different days of the week, or different times of the day? Try doing that with an online form.

#8 Posted by bassboy on Apr 28, 2011 12:11 AM

Fail site can’t process HTML tags, and the “downvote” leads me to the image of the arrows.

#9 Posted by bassboy on Apr 28, 2011 12:23 AM

My bad. I was using the NoScript extension.

#10 Posted by ChrisTX on Apr 28, 2011 8:22 AM

Adam, no I only find it amusing how one would even think of writing such an app.

btw, the guy’s site to download the script seems broken.
I can’t see thus how he does it, but I suppose some nice curl script or such.

Anyway, PowerShell does have HTTP access classes, too. You could port it thus. Could if you really believe you need a CLI pizza ordering application. In fact, you could even use DPAPI to store the creds in encrypted form. Again, if you’re very bored and hobbyless.

#11 Posted by kurkosdr on Apr 28, 2011 10:59 AM

“Notice that quantity is it’s own flag, meaning that no matter how many pizzas you order, they all must have the same toppings.”

LMAO! That’s the Linux way babe!.

You can have as many pizzas you want as long as they all have a piece of turd instead of sause* and melted condoms instead of cheese**

  • Xorg
  • PulseAudio

#12 Posted by ChrisTX on Apr 28, 2011 4:23 PM

http://www.youtube.com/watch?v=x7pPajOvQGo#t=1m21s

LOL, notice something? ( tip: start button ).

Rofl, he’s using a terminal emulator on Windows as well as I can see some Xorg running on Windows there.

#13 Posted by administrator on Apr 28, 2011 4:51 PM

@Adam, except that every online pizza ordering form keeps a history of what you ordered so you can not recall old orders but modify them as well.

#14 Posted by Adam_King on Apr 28, 2011 5:26 PM

Wow TM Repo man, so you went to “every online pizza ordering system” and confirmed that statement. I commend you.

#15 Posted by masterLoki on Apr 28, 2011 7:13 PM

Now that’s having nothing better to do with you time…

#16 Posted by administrator on Apr 28, 2011 7:24 PM

Dominos, the one, and only, supplier that the Pizza Party app does have order saving and recall. The difference is, I don’t have to remember to make an alias, it just keeps a history for me.

I encourage you to move the goal posts and claim that this is no big deal though, since it’s just ordering pizzas. Well, this is indicative of the FOSS community in general; Making something cumbersome then trying to convince everyone that they’re wrong for wanting it to be easier.

#17 Posted by Adam_King on Apr 28, 2011 7:41 PM

Does Dominos’s website support cronjobs?

#18 Posted by administrator on Apr 28, 2011 9:30 PM

That’s always my biggest issue, having pizzas delivered on a timer. If your life requires scheduled pizza delivery, you’re pretty pathetic.

Put it this way, if you think the CLI is better, then why not just write out the JSON string to send to their rest API. I can do it, so why can’t you?

#19 Posted by Adam_King on Apr 28, 2011 10:00 PM

That’s what I am trying to get at. The CLI is a perfectly useful programmatic interface.

#20 Posted by administrator on Apr 28, 2011 10:32 PM

No it isn’t! The CLI is a HUMAN interface. It’s just that when the invented it, the computers weren’t capable of displaying anything else.

Hell, the original CLI was a dot matrix printer. You think that they were feeding that dot matrix output back into the computer? NO! It was being read by the humans running the computer.

#21 Posted by Adam_King on Apr 28, 2011 10:49 PM

You are right, Bash scripts don’t exist. /s

It’s a dumb myth that Bash is the same as the shell UNIX had in the 70s. It’s not even remotely compatable to csh which would be a modern shell in comparison to the old UNIX shells.

These days shells are full programming languages in their own right. You got complex string manipulations, collections including lists and dictionaries, globbing, etc. build all right into the shell. And in fact it’s quite easy enough to call into Perl or Python or TCL from a Bash script to do more complex processing if needed.

#22 Posted by administrator on Apr 29, 2011 2:45 AM

I never said bash didn’t exist, what I’m saying is the CLI is meant as a human interface.

Scraping command output is the most inefficient way of automating a task when you consider the much richer and more direct access other languages have to the operating system’s functionality.

Scraping and parsing strings is as hackish as scraping html pages rather than using a RESTful API. Scraping is analogous to doing those dot matrix printouts only to retype (parse) them back into the computer. Scraping is like building a machine to type on a keyboard when using a direct connection over a port would be faster and less prone to error.

The analogies are endless for this. The CLI is essentially a “wooden table” solution.

#23 Posted by administrator on Apr 29, 2011 2:56 AM

And it still stands that the CLI is about the worst way you could order a pizza. Even phoning one is is more intuitive than this horrible interface that requires a manual to figure out.

Hmmm, did -p order pepperoni or peppers?

#24 Posted by ChrisTX on Apr 29, 2011 10:22 AM

“Scraping and parsing strings is as hackish as scraping html pages rather than using a RESTful API.”

Considering PowerShell does have System.Net.HttpWebRequest as well as it can load assemblies such as JSON.Net, you could access RESTful services from Windows CLI.

“And in fact it’s quite easy enough to call into Perl or Python or TCL from a Bash script to do more complex processing if needed.”

Which is terrible glue. Each of these has an entirely different framework which results in a weird mixture between those.
Also, try to do something as simple as to read an XML file in bash – http://stackoverflow.com/questions/893585/how-to-parse-xml-in-bash or http://www.humbug.in/2010/parse-simple-xml-files-using-bash-extract-name-value-pairs-and-attributes/ JUMMY. Or try to call a function withing a shared object file. Or try to encrypt a file using AES.

All the above examples would be easily doable in PowerShell – which was designed from scratch and does not base on the predecessor VBScript. Bash is still building on technology from the ’70s. Using Perl/Python directly does result in a much better solution tbh.

“Hmmm, did -p order pepperoni or peppers?”

PowerShell also solved that issue by a simple trick: You have the full name of a parameter, and can abbreviate it until it’s not anymore uniquely matchable ( because the shell knows the parameters a particular cmdlet has, you can also tab through them ). In this example, -Peppers and -Peppero would be uniquely matched and required for the shell to accept it.

Also, bash has the awesome power that parameters are case sensitive. So you can also confuse -P (pepper) and -p (pepperoni). Obviously.

Still ’70s technology. My favorite example of this is grep by the way: -B for —before-context, -b for —byte-offset, -U for —binary and -u for —unix-byte-offsets, -v for —invert-match, -V for —version while -i is for —ignore-case and -I for —binary-file=without-match . Seriously. -U for binary, because you see, there is a capital U in 'binary’. I’m also wondering how to memorize the difference between -v,-i and -I unless you’re literally stuck to the CLI every day. Also, -f means in a lot of CLI tools —force in others – like grep or PHP – —file=FILE.

Where is the logic in that?

#25 Posted by DrLoser on Apr 29, 2011 5:22 PM

Adam:

FWIW, which ain’t much, you start with sh, which was crap. Funny how even Linux still links sh to the “preferred” shell, which is never sh, isn’t it? Or not.

Then you have bourne, korn and csh, in rough (and I believe) chronological order.

csh is fail.

Let’s ignore things like zcsh, or whatever that abortionate thing based on a curses interface might have been.

We’re left with ksh, which actually is quite portable, and bourne, which isn’t really.

Bash is of course a mildly cleaned up version of the bourne shell, with added goodies like automatic emacs keystroke history (you would not believe how much this makes me happy) and so on.

And even bash is twenty years old now and dead as a vampire in the full moonlight at an open crossroads.

It’s all about OO scripting now. Get over it, little *nix script boy.

#26 Posted by Adam_King on Apr 29, 2011 6:39 PM

“Scraping command output is the most inefficient way of automating a task when you consider the much richer and more direct access other languages have to the operating system’s functionality.”

It’s all about the right tool for the job. For wiring alien processes together, you will never beat a language like Bash or zsh. That’s what they were BUILT for. No ceremonial bullsh!t, no OO and weird boilerplate code (yes even Python has a lot of boilerplate for doing something as simple as launching a process).

#27 Posted by ChrisTX on Apr 29, 2011 7:33 PM

@Adam, so how about PowerShell, where is the boilerplate code to start a process? Not seeing it.

#28 Posted by Adam_King on Apr 29, 2011 10:00 PM

“how about PowerShell”

No. Next?

#29 Posted by administrator on Apr 30, 2011 2:01 AM

“It’s all about the right tool for the job. For wiring alien processes together, you will never beat a language like Bash or zsh.”

No, a proper API is! Sure, not every application has an API, but then again, not every application has CLI support. How do you think the CLI talks to those silent background processes? That’s right, an API!

What’s pathetic is all these tools are on the SAME MACHINE and they still must talk to each other through a dialog made up of text parsing! This is acceptable when you’re dealing with heterogeneous systems across the web, but NOT when you’re dealing with the local system!

#30 Posted by bassboy on Apr 30, 2011 3:01 AM

“What’s pathetic is all these tools are on the SAME MACHINE and they still must talk to each other through a dialog made up of text parsing! This is acceptable when you’re dealing with heterogeneous systems across the web, but NOT when you’re dealing with the local system!”

Do you have any reason technical reason as to why talking through text parsing is “not acceptable”? Or, is it because you think OOP is cooler?

#31 Posted by administrator on Apr 30, 2011 3:14 AM

I didn’t say anything about OOP. I just mean that sending “1, 2, 3” around instead of an actual list is ridiculous. The overhead is enormous and the process is incredibly prone to error. Worse still, there’s no agreed on format so each command and utility spits out wildly different formatting meaning you can’t even make a general parser or tokenizer.

Imagine if I needed to pass the number 10 to a function in my application. It would make sense to send it AS THE NUMBER! Not convert it to a string, then pass it, only to have the function convert it from a string to an int again. What if the string parser assumed that because it’s 10, that it’s a short binary string instead of an int (some javascript implementations actually do this)? It’s like playing the telephone game, each time you make a conversion there’s a possibility of something being lost or corrupted.

#32 Posted by ChrisTX on Apr 30, 2011 7:29 AM

“No. Next?”

So why not? Not open?

http://blogs.msdn.com/b/powershell/archive/2011/04/16/powershell-language-now-licensed-under-the-community-promise.aspx

OH WAIT, it is an open specification!

Uhm, technical arguments on your side then?

“Do you have any reason technical reason as to why talking through text parsing is “not acceptable”? Or, is it because you think OOP is cooler?”

Yes, it is indeed. Sed’ing through and output is 70s technology.
The power lies within supporting both, OOP and text output.

Example: You want to search a file and want to add up the filesizes of the directory the files lies in.

Here’s how to do that in PowerShell:

gci ( gci -r -i side.vmt ).Directory | Measure-Object -Sum -Property Length

How do I do that in bash? Get the filename, sed the directory from it, du on the directory. Yummy yum yum.

First checkout PowerShell, then talk.

#33 Posted by Adam_King on Apr 30, 2011 10:30 AM

“No, a proper API is! Sure, not every application has an API, but then again, not every application has CLI support. How do you think the CLI talks to those silent background processes? That’s right, an API!”

In Linux virtually everything worth automating has a CLI interface. Actually many apps are simply wrappers around the CLI interface. Arguable, entire parts of Linux’s API (sysfs) are intentionally written to be easy to use from a CLI. Linux takes a lot of inspiration from Plan9 and UNIX in this manner.

#34 Posted by youagain on Apr 30, 2011 11:52 AM

Actually many apps are simply wrappers around the CLI interface.

lol, thats absolutely true, and thats also the reason why linux apps are so crappy.

#35 Posted by Adam_King on Apr 30, 2011 1:51 PM

No.

#36 Posted by administrator on Apr 30, 2011 2:51 PM

Put it this way Adam, automating via the CLI is equivalent to automating using something like MacroToolworks that actually performs mouse clicks and keyboard strokes on a Windows GUI. Sure, it works, but it’s a hack; The worst way to go about automating something.

It’s slow and prone to error.

#37 Posted by ChrisTX on Apr 30, 2011 3:23 PM

I translate:

“In Linux virtually everything worth automating has a CLI interface.”

In Linux we only offer a CLI interface, GUI is for Mac users.

“Actually many apps are simply wrappers around the CLI interface.”

We do have a GUI for certain parts but intentionally made crappy so you have to use the CLI.

“Arguable, entire parts of Linux’s API (sysfs) are intentionally written to be easy to use from a CLI.”

Unlike other systems we have sysfs which is totally awesome and beats WBEM/WMI which is standarized and works over the network, as well as supports structured queries, but you can use it from CLI. Nevermind that you can also do so with WMI on Windows, but we do it better.

“Linux takes a lot of inspiration from Plan9 and UNIX in this manner.”

Linux tries to clone UNIX but in the end, no – not even commercial ones – distro has ever achieved SUSv3 compliance, unlike OSX.

That’s why we say we take inspiration from – LOL! – Plan9.

Of course there might be PowerShell on Windows, but I am simply going to ignore that and make ridiculuous claims on how cmd on Windows is totally bricks compared against bash.

#38 Posted by Adam_King on Apr 30, 2011 3:33 PM

“Put it this way Adam, automating via the CLI is equivalent to automating using something like MacroToolworks that actually performs mouse clicks and keyboard strokes on a Windows GUI. Sure, it works, but it’s a hack; The worst way to go about automating something.”

Yeah I know. Personally I think everyone should replace their shell scripts with Python and Django.

#39 Posted by DigitalAtheist on Apr 30, 2011 4:18 PM

personally everyone shoiuld find a freetard who promotes CLI use over sane GUI use and condemn them to using nothing but an Apple ][ for the rest of their natural lives.

#40 Posted by administrator on Apr 30, 2011 4:20 PM

Obvious trolling, but, as always we feed the trolls, so here goes…

Django is a web framework, it has nothing to do with OS automation. If people actually DID write their shell scripts in Python they’d be a LOT easier to read, be portable across multiple platforms and unit testable.

#41 Posted by DrLoser on Apr 30, 2011 5:14 PM

Funnily enough, I did precisely that (in a Microsoft environment, yet).

I couldn’t be bothered to document the end user interface for selecting a particular set of statistical constraints (given a choice of ten per country, and five or six countries), so I wrote the whole thing up in Django and Python. Took me about a day or so. It would have taken just as long in bash (on cygwin).

The interesting thing is that I came back to it two weeks later and could still understand how the interface worked. I guarantee you that, if I’d been a clueless n00b like King, I’d have totally forgotten and had to hack the thing up again from scratch.

Python and Django ftw!

#42 Posted by Adam_King on Apr 30, 2011 7:39 PM

“If people actually DID write their shell scripts in Python they’d be a LOT easier to read [for me]”

Fixed. Nothing everyone cares to learn Python. The shell works just fine for automation. End of story.

#43 Posted by Adam_King on Apr 30, 2011 7:42 PM

Nothing = not

#44 Posted by administrator on May 1, 2011 3:43 AM

They’re easier to read because you don’t have cryptic one letter flags all over the place, not because of syntax.

Can you explain to me how I can use bash to automate Photoshop? Oh, that’s right, it has an API, an actual APPLICATION PROGRAMMING INTERFACE, not a command line interface!

#45 Posted by ChrisTX on May 1, 2011 7:44 AM

“Can you explain to me how I can use bash to automate Photoshop?”

You use GIMP, obviously. Hope it helps.

“Oh, that’s right, it has an API, an actual APPLICATION PROGRAMMING INTERFACE, not a command line interface!”

Right, bash does fall flat there. Calling native functions is simply impossible.

PowerShell? Not so much ( ie. http://pastebin.com/jRQt6Nfk )

But I’m sure bash is still the #1 scripting and CLI language.

#46 Posted by Adam_King on May 1, 2011 12:03 PM

“Can you explain to me how I can use bash to automate Photoshop? Oh, that’s right, it has an API, an actual APPLICATION PROGRAMMING INTERFACE, not a command line interface!”

No, it’s about using the write tool for the job. If I want to selectively move files around, I can probably do it with a single line of code in Bash. Or install applications. Bash really shines with anything that involves stringing processes together, not for automating a single process. That’s because Bash (like all shells), running a process is a “command”, and it also supports pipeline the output of one command into the input of another.

You CAN do this in Python, it’s just more code. And at the same time, that’s just another language you have to learn.

It makes sense for someone like you who writes web apps obsessed with Python or PHP (hint: you can write web apps in shell script, but I’d recommend against it). Shell script is very much the language of system administration.

It’s all about using the right tool for the job, as I’m sure you’ve heard before.

#47 Posted by Adam_King on May 1, 2011 12:07 PM

To be clear: Running a process is a “command” means running a process is a first-class language construct (there is no “API” for doing it like most languages, in shell it’s a PART of the language).

#48 Posted by ChrisTX on May 1, 2011 12:25 PM

Aha, and so how is bash the right tool for uh web queries?

Thought we were already past the point that bash does not have REST support? No?

#49 Posted by DrLoser on May 1, 2011 5:20 PM

BASH — it moves files selectively around in one line!”

Yes, well, that’d be the tool for the job alright. Actually, you’ll find that one line has semi-colons in it … which in CS terms means it isn’t a single line.

Now, let’s see what happens when I want to chain two commands together. I have no need to grobble through man pages, because I am l33t (yes, Adam, I’ve been programming shell scripts since before you were sentient. A good half hour or so, I should say). And I’ve got the wonderful *nix pipe!

Xept the output of one command doesn’t match the input of another. That’s all right, I’ve got awk. And errors appear on a different stream — if they appear at all. That’s all right, I’ll just redirect stderr to /dev/null^W^W a temporary file, and when I’m done I’ll fork another process that merges all the temporary error files into one. I think I’ll use sort and cut while I’m at it. Perhaps I can `echo “^G` just to let myself know that there was an error? (This obviously won’t work on all linuxen. It rather depends upon having a functional audio stack.)

I missed out tee, but that’s triffically useful as well.

Or I could just do what ALL NORMAL *NIX PROGRAMMERS DO, and use Python. Or, if you insist, Perl. Or even Ruby.

Nobody uses shell scripts any more, Adam. Not even Linux programmers. Get over it.

#50 Posted by DrLoser on May 1, 2011 5:24 PM

This “lack of an API” whereof you speak. That wouldn’t be the backticks, would it? Because they look awfully like an API to me. In fact they look awfully like syntactic sugar (in this case syntactic grit) for system(“my command goes here”).

Not a particularly adept API, I’ll grant you. Not elegant. Not flexible. Not especially amenable to error detection, as with yer actual API.

But still 'n’ all, it’s an API.

If you live in the seventies.

#51 Posted by administrator on May 2, 2011 4:25 AM

Face it, Adam doesn’t even know what an API actually is. He thinks the only way to create a file is to wrap “touch”.

#52 Posted by Adam_King on May 7, 2011 11:27 AM

“Face it, Adam doesn’t even know what an API actually is. He thinks the only way to create a file is to wrap “touch”.”

If it can’t be automatically introspected from Python, it can’t possibly be an API!

#53 Posted by DigitalAtheist on May 8, 2011 12:22 AM

Face it, if you need to use a CLI you’ve failed… HORRIBLY!

#54 Posted by Adam_King on May 8, 2011 12:22 PM

Except when using the CLI allows me to do productive things that make me money. I know. Impossibility!

You must be signed in to leave comments.