当前位置: 首页 > linux > 正文

linux 环境变量中配置参数 use function but not use alias

例子:使用两个参数匹配域名,其他部分自动补齐,减少键盘输入,然后ssh登陆到目的主机。
cat .bashrc 
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# update the PATH
export PATH=${PATH}:/usr/sbin:/sbin
sss() {
  ssh $1.$2.2hei.net
}
use:
$sss test blog 
The authenticity of host ‘test.blog.2hei.net (192.168.1.12)’ can’t be established.
RSA key fingerprint is 00:45:c8:28:29:cd:a6:50:26:a6:5d:23:a4:fb:10:9a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘test.blog.2hei.net,192.168.1.12’ (RSA) to the list of known hosts.
[email protected]’s password: 
Last login: Thu Jun  9 06:12:21 2011 from 192.168.1.11
Kickstart-installed Red Hat Linux Wed Sep 15 22:25:51 UTC 2010
$

本文固定链接: http://2hei.net/linux_use_function_but_not_use_alias.html | 2hei's site

该日志由 2hei 于2011年06月20日发表在 linux 分类下,
原创文章转载请注明: linux 环境变量中配置参数 use function but not use alias | 2hei's site
关键字:

报歉!评论已关闭.