Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ Challenge [Extremely Easy]

Name: Anonymous 2008-04-26 19:39

Create a program that gives this as its output: http://pastebin.ca/998836

Name: Anonymous 2010-06-04 15:55

>>106,110,111

1. grep might be in one of several different places depending on OS; on many Linux distros, for example, it's ordinarily in /bin so that just won't work at all.
2. Disregarding that and fixing the location as appropriate, hashbangs normally only can take one single argument. So what happens is you get argv = {"grep", "-v '#'"} and it complains about invalid options.
3. Even if you could have multiple arguments, exec is not /bin/sh and thus does not follow its quoting rules, so you would end up with the single quotes in the argument list, and so it would still print every line.
4. Pedantically, there's a blank line at the start of your post.

A way to do this that actually functions might be:
#!/bin/grep ^[^#]
DURRRRRR

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List