【发布时间】:2011-04-01 20:20:36
【问题描述】:
所以我的问题是如何在 Linux 中使用终端命令将文件参数传递给我的 bash 脚本?
目前我正在尝试用 bash 制作一个程序,该程序可以从终端获取文件参数并将其用作程序中的变量。例如我跑
myprogram --file=/path/to/file 在终端中。
我的程序
#!/bin/bash
File=(the path from the argument)
externalprogram $File (other parameters)
如何通过我的程序实现这一点?
【问题讨论】:
标签: linux bash shell command-line terminal