Dan*_*Dan 4 mac bash terminal.app curl .bash-profile
我发现这个提示超级有用,使用curl恢复中断的文件复制。
完整的语法是:
curl -C - -O file:///Volumes/path/to/file
Run Code Online (Sandbox Code Playgroud)
我想添加一个别名或函数调用resume到我的.bash_profile(在 Mac 上),以便我可以使用类似的东西
resume /Volumes/disk1/file
Run Code Online (Sandbox Code Playgroud)
我打算尝试类似的东西
function resume() { ... }
Run Code Online (Sandbox Code Playgroud)
但我不确定如何使用file:///前缀传递参数。
函数就像脚本一样接收参数,因此您可以使用$1来引用传递的第一个参数:
resume () {
curl -C - -O "file://$1"
}
Run Code Online (Sandbox Code Playgroud)
请注意,您不需要两者function 和括号;任何一个都告诉 bash 它是一个函数。
| 归档时间: |
|
| 查看次数: |
2160 次 |
| 最近记录: |