Curiosity, learning and homework help
27/07/2024
Sign upLog in
Language: FR | ENG

NEWSLETTER

:

MEMBERS

Come to discuss on the forum!
 FAST and FREE signup. 
😀 Access to discussion forums 😀
Help for HOMEWORKS, support in COMPUTER SCIENCE, help for learning FRENCH and ENGLISH, discussion on your INTERESTS and HOBBIES...

Following numerous requests, a new forum on PIPENET Vision has been created!

Looking for an English version of this section?

This section is in French because the contents are in French. If you prefer the English version of this section, click on the link below.
However, the contents in the French and the English sections are not necessarily the same!
Contents for computer science in English


Différentes façons de lancer un script
Il existe plusieurs manières de lancer un script dans un shell.

  • Exécuter 'script' s'il est exécutable et situé dans le répertoire courant :
  • ./script

    Le ./ indique le répertoire courant. Il est nécessaire de le préciser car le répertoire courant n'est généralement pas dans la variable $PATH.

  • Exécuter 'script' si le fichier est exécutable et situé dans un répertoire indiqué dans la variable $PATH :
  • script

  • Sourcer 'script' :
  • source script

    Le fichier n'a pas besoin d'être exécutable mais doit être un script shell valide. Le fichier peut être dans le répertoire courant ou dans un répertoire indiqué dans la variable $PATH.

  • Sourcer 'script' (variante syntaxique) :
  • . script

    'source' est un alias de la commande '.' définie par bash et d'autres shells.

Cependant, exécuter un script et sourcer un script sont deux opérations différentes : Différence entre "exécuter" un script et "sourcer" un script.
Share this page on social media:
Quick comments
There is no comment yet.

Use of cookies on this website:
- If you are not a member of this website, no cookie is intentionally stored on your computer.
- If you are a member of this website, cookies are only used to keep your connection after each visit. This option can be deactivated at will in your profile and is deactivated by default.
- No other information is stored or retrieved without your knowledge, neither your personal information nor any other whatsoever. If in doubt, do not hesitate to contact the administrator of this website .
- Even this information banner does not use cookies and will therefore be displayed constantly on each visit on all pages of the website.