Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the consequence of the period in this line of bash script?

Tags:

bash

I am running a bioinformatics web application on a compute cluster and I'm trying to troubleshoot some issues. The webapp runs a predefined shell script that passes cluster compute parameters (stored in a file named defaultJobRunner.sh before running the computationally-intensive work.

For each job that is created, an accompanying shell script is created which contains the following line:

[ -f "/home/galaxy/defaultJobRunner.sh" ] && . /home/galaxy/defaultJobRunner.sh

I understand this to be short-form for "if the file in the square brackets is a regular file, then run it. What I don't understand is the function or significance of that period between && and /home/galaxy/defaultJobRunner.sh

like image 720
DeeDee Avatar asked Jan 28 '26 12:01

DeeDee


1 Answers

It's short for source. It runs /home/galaxy/defaultJobRunner.sh as though each line had been typed into the current session. (source)

like image 66
nmichaels Avatar answered Jan 31 '26 01:01

nmichaels



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!