Well, IBM publishes a new article about useful Unix command line habits as a follow-up to Michael Stutz’s article. I promise that after reading this article you will say something like “A-ha, I didn’t know you could do that!” :) Here is the part of that staff:

The !$ command returns the last argument used with a command. But what happens if you have a command that used arguments and you want to reuse just one of them? The !:1 operator returns the argument used in a command. The example in Listing 3 shows how you can use this operator in combination with the !$ operator. In the first command, a file is renamed to a more meaningful name, but to preserve use of the original file name, a symbolic link is created. The file kxp12.c is renamed in a more readable manner, then the link command is used to create a symbolic link back to the original file name, in case it’s still used elsewhere. The !$ operator returns the file_system_access.c argument, and the !:1 operator returns the kxp12.c argument, which is the first argument of the previous command.

Listing 3
$ mv kxp12.c file_system_access.c
$ ln –s !$ !:1

Read more here

unix front

 

2 Comments

 

  1. March 30, 2012  8:02 pm by fruit mocking party Reply

    The crux of your writing while sounding agreeable initially, did not really work very well with me personally after some time. Somewhere within the paragraphs you actually were able to make me a believer unfortunately only for a while. I however have got a problem with your leaps in logic and you would do nicely to help fill in those breaks. In the event that you can accomplish that, I will undoubtedly end up being fascinated.

  2. March 22, 2013  9:16 pm by flight deals india Reply

    Hey! Quick question that's totally off topic. Do you know how to make your site mobile friendly? My site looks weird when browsing from my apple iphone. I'm trying to find a theme or plugin that might be able to fix this problem. If you have any suggestions, please share. Thank you!| flight deals india http://www.funtraveldeals.com/book-flights/

Leave a reply

 

Your email address will not be published.