在变量中运行bash“find”命令

时间:2018-03-15 13:53:45

标签: bash find quoting

# Let's have a few test files
$ touch alpha beta
$ find ./*
./alpha
./beta

# Try find with filtering
$ find ./* -not -path './beta'
./alpha

# Now again, but save the command in a variable
$ F="find ./* -not -path './beta'"
$ echo "$F"
find ./* -not -path './beta'
$ $F
./alpha
./beta

为什么会这样?关于引用的东西......?

0 个答案:

没有答案