launch bash without using any letters

"$(- 2>&1)";${_%%:*}
I don't know why anyone would use this, I was just messing around tonight and managed to start bash without using any letters and thought I would share. It's pretty simple, first it tries to execute "-" redirecting stderr to stdout which prints the error "bash: -: command not found" to standard output, then I try to execute "bash: -: command not found" which produces the output "bash: bash: -: command not found: command not found". lastly, (on the other side of the semicolon) I use the underscore environment variable which refers to the last command run ("bash: -: command not found") and take out everything after the first ":" character using brace expressions and your left with "bash"
Sample Output
seth@Laptop:~/Code/deb/tmp$ "$(- 2>&1)";${_%%:*}
bash: bash: -: command not found: command not found
seth@Laptop:~/Code/deb/tmp$ exit

By: LinuxMan
2012-12-29 09:21:09

2 Alternatives + Submit Alt

What Others Think

Curious, but hardly useful, as you need to be in bash. Why would yo need to exec a subshell?
netizen · 508 weeks and 1 day ago
this doesn't really have a purpose, but it opens the possibility of writing entire scripts without using letters, similar to what was done in this article with javascript: also, you are right, i don't need the subshell around the ${}, I'll fix that right away
LinuxMan · 508 weeks and 1 day ago
Accidentally i have come across this website and see the details regarding the commands you have Restaurant Loans shared here. You can learn lots of unix commands from here and this one gives information regarding how to launch bash without using any letters. Good to see its alternatives here.
Alyssalauren · 28 weeks and 4 days ago
Pug Puppies for Sale Near Me pugs puppies for sale teacup pugs for sale pug puppies for sale by owner pug puppies ohio PUG PUPPY FOR SALE NEAR ME PUG PUPPIES FOR SALE pug puppies for sale in kentucky Pug Puppies for Sale Under $500 Near Me pug puppies for sale in texas Amazing! This blog looks just like my old one! It's on a completely different subject but it has pretty much the same layout and design. Wonderful choice of colors!
rahimhh21 · 5 weeks ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: