以下是来自命令行的输入:
bash script.sh "input*" ";" "21" "yyyy-MM-dd"
在我当前的目录中我有两个输入文件:
虽然我想从输入' $ 1' 获得'输入*' ,但我得到& #39; input1.txt input2.txt' 作为输入。
有没有办法从' $ 1' 获得价值'输入*' ?
答案 0 :(得分:-1)
you can use "$1"
where 1
is the number of first input parameter
#!/bin/bash
echo "$1"
but you have to pass the input*.txt
like this input\*.txt
output
[shell] ➤ ./test7.sh input\*.txt
input*.txt
Regards
Claudio