小编AZo*_*rin的帖子

如何使用Linux中的终端命令将文件参数传递给我的bash脚本?

所以我的问题是如何使用Linux中的终端命令将文件参数传递给我的bash脚本?目前我正在尝试在bash中创建一个程序,该程序可以从终端获取文件参数并将其用作程序中的变量.例如我myprogram --file=/path/to/file在终端中运行 .

我的计划

#!/bin/bash    
File=(the path from the argument)  
externalprogram $File (other parameters)
Run Code Online (Sandbox Code Playgroud)

如何通过我的程序实现这一目标?

linux bash shell terminal command-line

42
推荐指数
3
解决办法
17万
查看次数

标签 统计

bash ×1

command-line ×1

linux ×1

shell ×1

terminal ×1