[clug] Another esoteric question...

Nemo wombat at nemo.house.cx
Mon Nov 24 03:52:36 GMT 2008



Technically it's two fewer characters to type, and up to
4 fewer keystrokes depending on how you type/count
keystrokes for multiple shift+key,key characters)

It's pedantic I know :)  ...but these are why I use backticks for
simple commandlines like shown :)

.../Nemo


On Sat, 22 Nov 2008 09:49:51 +1100, Duncan Roe <duncan_roe at acslink.net.au>
wrote:
> I always use the bash "type" builtin in preference to "which".
> 
> Then you could type "vi $(type -p mycommand.sh)"
> 
> (or use the old-style backticks - 1 less character to type ;)
> 
> Cheers ... Duncan.
> 
> 
> On Thu, Nov 20, 2008 at 01:55:48PM +1100, Andrew Janke wrote:
>> Given that my last question (terminal encoding: ^V^O) was so
>> comprehensively answered. Here is another of my niggling shell
>> questions that has annoyed me for a long time.
>>
>> Is there a way where you can use some sort of variable in a subsequent
>> command that matches the output of the last command ala !$ with the
>> last argument from the previous command.
>>
>> ie:
>>
>>    $ which mycommand.sh
>>    /usr/local/bin/mycommand.sh
>>
>>    $ vi <something>
>>
>> Where <something> is /usr/local/bin/mycommand.sh
>>
>> Currently I do this via a dodgy shell function 'vs' (vi script):
>>
>>    function vs () {
>>       vim `which "${1}"`
>>       }
>>
>> ta
>>
>>
>> --
>> Andrew Janke
>> (a.janke at gmail.com || http://a.janke.googlepages.com/)
>> Canberra->Australia    +61 (402) 700 883
>> --
>> linux mailing list
>> linux at lists.samba.org
>> https://lists.samba.org/mailman/listinfo/linux
> 
> --
>  Please avoid sending me Word or PowerPoint attachments.
>  See http://www.gnu.org/philosophy/no-word-attachments.html
> --
> linux mailing list
> linux at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux



More information about the linux mailing list