Metamorphosis
RSS feed

如何保存shell中正则匹配的结果?

for file in ./a*/data; do scp -qr $file user@host.name:~/${file/\/data/_data}; done;

if rootdir is on a remote host, try

for file in `ssh user@host.name "ls /rootdir/a*/data"`; do scp -qr user@host.name:${file/:/} ${file/\/data/_data}; done;
原发布于 https://www.zhihu.com/question/19888200/answer/13259778


published 22 Oct 2011
blog comments powered by Disqus

Existentials

  • github
  • flickr
  • twitter
  • facebook
  • linkedin

Blogroll

  • wonderfulmore
  • 北京人在悉尼
  • sukie赵
  • cjPanda
  • btsb
  • vivian
  • cityyoho
  • maple
  • tulip
  • 坦克梁
  • stone
  • pavements
  • 问号鱼
  • Schlaraffenland
  • 東亞毒液學研究所
  • 草木贲华
  • 三楼的卡西欧计算器
  • 追忆吹水年华
  • bad habits die hard
  • 多说无益
  • 一天世界
  • 得果德语