easy to cp files from windows to wsl
一个方便从windows复制文件或者目录到wsl的一个shell脚本。
▲ 效果
源码如下
1 | str=$1 |
字符串要替换第一个匹配的目标,写法为${str/old/new},若要全部替换则为${str//old/new}。
主要要记下xrags的用法,下面是man xrags的解释。
1 | -I replace-str |
-I和i大体上的意思是将xrags导过来的数据用{}取代
另外cut用-d选项指定分隔符,默认为制表符(TAB)。
- Blog Link: https://unihon.github.io/2019-01/easy-to-cp-files-from-windows-to-wsl/
- Copyright Declaration: The author owns the copyright. Please indicate the source reproduced!