As described here Is there a difference between “.” and “source” in bash, after all?, I'm trying to set-up this approach in a simple script without success so far (Raspian Jessie). When using the following code:
#!/bin/bash cat /media/usb0/tmp/NT20.sh echo $var1
as expected it lists the content of the file. However when using this code:
#!/bin/bash source /media/usb0/tmp/NT20.sh
#!/bin/bash . /media/usb0/tmp/NT20.sh
I get this error returned: "source not found". There must be something quite obvious that I don't understand. Or is the source command not support by this flavor of bash on Jessie Lite?
NT20.sh file is:
This idea behind this is to be able to store a persistent variable and read it when needed. Thank you for help.