Venez discuter sur le forum ! ■ Inscription RAPIDE et GRATUITE. ■ |
😀 Accès aux forums de discussion 😀 |
SOUTIEN SCOLAIRE, aide en INFORMATIQUE, aide pour apprendre le FRANÇAIS et l'ANGLAIS, discussion sur vos centres d'INTÉRÊTS et LOISIRS... |
Vous recherchez la version française de cette section ?
Cette section est en anglais parce que les contenus sont en anglais. Si vous préférez la version française de cette section, cliquez sur le lien ci-dessous.
Cependant, les contenus des sections française et anglaise ne sont pas nécessairement les mêmes !• Contenus sur l'informatique en français •
Cependant, les contenus des sections française et anglaise ne sont pas nécessairement les mêmes !
Different ways to run a script
There exist several ways to run a script in a shell.
./ means the current directory. It is necessary to specify it because usually the current directory is not in the $PATH variable.
Execute 'script' if the file is executable and located in a directory listed in the $PATH variable:
Source 'script' :
The file does not need to be executable but must be a valid shell script. The file can be in the current directory or a directory listed in the $PATH variable.
Source 'script' (syntax variant) :
'source' is an alias of the command '.' defined by bash and other shells.
However, executing a script and sourcing a script are two different operations: Difference between "execute" a script and "source" a script.
- Execute 'script' if it is executable and located in the current directory:
./script
./ means the current directory. It is necessary to specify it because usually the current directory is not in the $PATH variable.
script
source script
The file does not need to be executable but must be a valid shell script. The file can be in the current directory or a directory listed in the $PATH variable.
. script
'source' is an alias of the command '.' defined by bash and other shells.
However, executing a script and sourcing a script are two different operations: Difference between "execute" a script and "source" a script.
Partager cette page sur les réseaux sociaux :
Des questions, des commentaires ?
Commentaires rapides
Il n'y a pas encore de commentaires.