Thursday, May 2, 2024
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 1237  / 1 Year ago, fri, december 23, 2022, 7:19:49

What is the difference between running the script by calling directly its name and

calling the script by adding a with prefix of './' .

I can't find any difference in run time.


More From » command-line

 Answers
7

If the scripts directory isn't in your PATH, and . (the current directory) is not in the PATH either, you can run the script using ./ as shown below



./script_name.sh 


Use the script file name to run it either by using it’s relative path or absolute path as shown below:



cd /home/user
./script_name.sh


OR



/home/user/script_name.sh

[#21187] Saturday, December 24, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
iedncommon

Total Points: 200
Total Questions: 95
Total Answers: 132

Location: Tonga
Member since Mon, Aug 2, 2021
3 Years ago
iedncommon questions
Sat, Jun 4, 22, 18:20, 2 Years ago
Mon, Apr 4, 22, 08:10, 2 Years ago
Tue, Jul 6, 21, 15:11, 3 Years ago
;