【发布时间】:2021-02-01 05:29:58
【问题描述】:
是否可以从 shell 脚本传递参数并将其传递给文件。 这就是我本质上想要实现的目标:
我的脚本:
#!/bin/bash -
input=$1
DIR=/home/user/
File=$DIR/test.txt
`cat $File` < $input
这是 test.txt:
select * from abc where date=$input;
我对这些东西很陌生。如果有正确的方法,请提供帮助。
【问题讨论】:
-
由于您是Shell 新手,我建议您至少阅读upload.wikimedia.org/wikipedia/commons/8/81/…
-
感谢您的链接。会通过的!!