commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
There are 3 alternatives - vote for the best!
If script.sh contains only these two lines:
$ uname -a
!# is the currennt line so far, by using !#:- you can go from the second arg (it's zero indexed) to the last ($)
(did I understand the problem correctly?)
since we're repeating the command there after the semicolon, we only need one backtick
Is there a way to print the line BASH is executing without copy+paste the line inside an 'echo' command?
If you can do better, submit your command here.
You must be signed in to comment.