How do we separate variables from letters in shell scripting?

前端 未结 5 570
误落风尘
误落风尘 2020-12-11 14:37

I tried printing \"Dogs are the best.\" with this bash script.

#!/bin/bash

ANIMAL=\"Dog\"
echo \"$ANIMALs are the best.\"
exit 

However, I

5条回答
  •  無奈伤痛
    2020-12-11 15:41

    Useless quotation, useless exit. A finished script needs no help to exit but the exit will bite you when sourcing that script.

    ANIMAL=Dog
    echo ${ANIMAL}s are the best.
    

提交回复
热议问题