Welcome to the Linux Foundation Forum!

Difference in the following script

Hi All,

In my shell script when I use
PID4=ssh ans02 'su -c "/home/ansys_inc/v193/RSM/ARC/tools/linx64/arcnode status" arcuser exit'
it works

but when I use it as follows it doesn't work
PATH=/home/ansys_inc/v193/RSM/ARC/tools/linx64/arcnode
PID4=ssh ans02 'su -c "$PATH status" arcuser exit'

Any idea or what I need to change in the above script.

Thanks,
PadLing

Answers

  • When you use single quotes, the $ sign is taken literally:
    maurelio@Lenovo-Yoga-2-Pro:~$ echo '$PATH'
    $PATH

Categories

Upcoming Training