bash: not a bug, a feature .... (?)

export Q='() { a=$(pwd); [ -z "$Q_env" ] && export Q_env=$*; b=$Q_env; echo "a=$a, b=$b,"; }; Q $(pwd)'; bash -c "Q; cd ~/Desktop; Q"
It looks like this "feature" let us to "eval" and "bind" a lexical env at subshell start. For sure, it could have some 'legal' use ...
Sample Output
a=/home/gio, b=/home/gio,
a=/home/gio, b=/home/gio,
a=/home/gio/Desktop, b=/home/gio,

By: hute37
2014-09-27 12:05:45

What Others Think

This code is very useful. Thanks Lancaster Cleaning
mark21 · 54 weeks and 5 days ago
Wonderful article, thanks for putting this together! This is obviously one great post. Thanks for the valuable information and insights you have so provided here.
johnlead · 51 weeks and 4 days ago
These encodings make me very tired, sometimes it becomes unbearable, in such cases, you can try to play football legends like me.
ryanmsaulters · 42 weeks ago
I am impressed. I don't think Ive met anyone who knows as much about this subject as you do. You are truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. Really, great blog you have got here. ???????
hamnakt15 · 41 weeks and 1 day ago
Your article has proven useful to me. It’s very informative and you are obviously very knowledgeable in this area. You have opened my eyes to varying views on this topic with interesting and solid content. Tax and accounting service
hamnakt15 · 40 weeks and 5 days ago
Its as if you had a great grasp on the subject matter, but you forgot to include your readers. Perhaps you should think about this from more than one angle. ?????
hamnakt15 · 40 weeks and 3 days ago
Its as if you had a great grasp on the subject matter, but you forgot to include your readers. Perhaps you should think about this from more than one angle. ?????
hamnakt15 · 40 weeks and 3 days ago
This is also a fair post which I really savored the experience of scrutinizing. It isn't every day that I have the probability to see something like this.. best forex ea
yoknutarza · 35 weeks and 2 days ago
I found Hubwit as a transparent s ite, a social hub which is a conglomerate of Buyers and Sellers who are ready to offer online digital consultancy at decent cost.
leltuyarte · 32 weeks ago
I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work. Selling Credit Card Processing
leltuyarte · 31 weeks and 5 days ago
I’m excited to uncover this page. I need to to thank you for ones time for this particularly fantastic read !! I definitely really liked every part of it and i also have you saved to fav to look at new information in your site. parenting
leltuyarte · 31 weeks and 1 day ago
I think about it is most required for making more on this get engaged
leltuyarte · 31 weeks ago
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own Blog Engine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it. chat avenue
leltuyarte · 30 weeks and 4 days ago
I’m happy I located this blog! From time to time, students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. nice one
yoknutarza · 30 weeks and 1 day ago
I like this site very much, Its a really nice situation to read and get info . ?????????
leltuyarte · 30 weeks ago
It is perfect time to make some plans for the future and it is time to be happy. I’ve read this post and if I could I desire to suggest you few interesting things or tips. Perhaps you could write next articles referring to this article. I want to read more things about it!
leltuyarte · 29 weeks and 6 days ago
thank you for your interesting infomation. forex expert advisor reviews
seoby3 · 24 weeks and 1 day ago
This is an awesome motivating article.I am practically satisfied with your great work.You put truly extremely supportive data. Keep it up. Continue blogging. Hoping to perusing your next post
leltuyarte · 23 weeks and 1 day ago
Your work is truly appreciated round the clock and the globe. It is incredibly a comprehensive and helpful blog. ;nflbite : NFL Bite VPN Review
captain · 11 weeks ago
I don't understand the code. And I never spent time in understanding it. Because I have always hired developers. I wonder if the can help with mobile app development for my project too? I don't want to hire lazy developers. I only want to see those who are willing to work!
cryptolover · 2 weeks ago
Your request looks a little bit vague. What if you elaborate more about what is that you need? When you are looking for developers for your apps, perhaps you should bear in mind whether you need project- or product-oriented people. Here you can read more about it and what the advantages of each approach are. I think that the right focus will help you get the right result.
SoamesRuth · 2 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: