Shell 中eval的用法

test.sh:
pipe="|"
eval ls $pipe wc -l


输出
bogon:Desktop macname$ ./test.sh
45


test.sh:
eval echo \$$#


输出
bogon:Desktop macname$ ./test.sh ssd dede ded dedeeeee iiii
iiii

参考:
https://blog.csdn.net/luliuliu1234/article/details/80994391

猜你喜欢

转载自www.cnblogs.com/sea-stream/p/11396291.html
今日推荐