Printing asterisk (“*”) in bash shell

后端 未结 2 1587
被撕碎了的回忆
被撕碎了的回忆 2020-12-02 02:14
a=5
echo \"*/$aMin * * * * bash /etc/init.d/ckDskCheck.sh\"

When I try to run the following code, it displays properly

*/5 * * * *          


        
2条回答
  •  既然无缘
    2020-12-02 02:47

    You must use double quote when echo your variable:

    echo "$cronSen"
    

    If you don't use double quote, bash will see * and perform filename expansion. * expands to all files in your current directory.

提交回复
热议问题