关闭

vim 脚本测试

74人阅读 评论(0) 收藏 举报
delfunction Mytest
function Mytest()
if has('win32')
    !dir > 1.txt

else
    let sc =  "if [[ \$(who am i) =~ \\([-a-zA-Z0-9\\.]+\\)\$ ]] ; then echo SSH; else echo no; fi"
    let sc1 = "who mom likes"
    let sc2 = "ls -l"
    let sc3 = "whoami"
    let sc4 = "cat /proc/$PPID/status | head -1 | cut -f2"
    let v1 = system(sc1)
    echo v1
    if v1 == "SSH"
        echo "call from remote machine"
    else
        echo "call from local machine"
    endif
    echo "is end"
endif
endfunction

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:15207次
    • 积分:394
    • 等级:
    • 排名:千里之外
    • 原创:17篇
    • 转载:26篇
    • 译文:4篇
    • 评论:0条