sorry if this has been discussed and rejected before, I'm new to the list, I did google but didn't find anything. -- quite often I use ssh and scp within a few minutes, so I might do this... scp myfile user at host.example.com: ssh user at host.example.com it would make life a lot easier if I could type scp myfile user at host.example.com: ssh !$ or sometimes I simply copy too much and paste in host name and then have the faff of removing it. ok, that's a particularly bad example of being lazy :-) for the above to work, ssh would have to ignore the colon, that's all. I don't think the colon can have any significance in the hostname, so throwing it away wouldn't be harmful!? I could write a wrapper script, but I'm lazy, and figured it would be nicer if ssh could simply have this quick hack... please thanks for your time Paul
> From: Paul Mansfield <paul.mansfield at taptu.com> > Subject: ssh feature - ignore colon in host name > > it would make life a lot easier if I could type > scp myfile user at host.example.com: > ssh !$ > > or sometimes I simply copy too much and paste in host name and then have > the faff of removing it. ok, that's a particularly bad example of being > lazy :-)What about [Esc]-[.]. This would display the last argument of the previous command. You would then just have to remove the colon with backspace, for instance.
Paul Mansfield wrote:> I don't think the colon can have any significance in the hostname,It has in IPv6 addresses. //Peter
On 2010-02-19 12:21, Paul Mansfield wrote:> sorry if this has been discussed and rejected before, I'm new to the > list, I did google but didn't find anything. > -- > > quite often I use ssh and scp within a few minutes, so I might do this... > > scp myfile user at host.example.com: > ssh user at host.example.com > > it would make life a lot easier if I could type > scp myfile user at host.example.com: > ssh !$ > > or sometimes I simply copy too much and paste in host name and then have > the faff of removing it. ok, that's a particularly bad example of being > lazy :-) > > for the above to work, ssh would have to ignore the colon, that's all. I > don't think the colon can have any significance in the hostname, so > throwing it away wouldn't be harmful!? > > I could write a wrapper script, but I'm lazy, and figured it would be > nicer if ssh could simply have this quick hack... pleaseThis, as others have mentioned, does not belong in ssh. However, you can very easily do this without creating a wrapper script. Just add the following to your .zshrc (or rewrite for other shells): function ssh() { /usr/bin/ssh $@[1,-2] ${@[-1]%:} } This will invoke (the real) ssh with all the positional arguments, except ":" will be removed from the last argument, if present. No extra files needed, no wrapper scripts, no measurable performance hit, standard ssh software. Better solution in my book :) -- Med venlig hilsen Christian Iversen