Bash: Run Script on the Fly: Difference between revisions

From WikiMLT
m (Стадий: 2 [Фаза:Разработване, Статус:Създаден]; Категория:Linux Server)
m (Стадий: 6 [Фаза:Утвърждаване, Статус:Утвърден]; Категория:Linux Server)
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude><!--[[Category:Linux_Server|?]]-->{{ContentArticleHeader/Linux_Server}}</noinclude>
<noinclude><!--[[Category:Linux_Server|?]]-->{{ContentArticleHeader/Linux_Server}}</noinclude>
== References ==


* ...
== Example ==
The <code>curl</code> command will fetch the installation script from the repository [https://github.com/mrbvrz/segoe-ui-linux github.com/mrbvrz/segoe-ui-linux] and by the help of the process substitution operator <code><(...)</code> (which will be treated as pseudo-file) the output of <code>curl</code> will be executed via <code>bash</code>.<syntaxhighlight lang="shell" line="1">
bash <(curl -s https://example.com/path-to/raw/install.sh)
</syntaxhighlight><syntaxhighlight lang="shell" line="1">
curl -s https://example.com/path-to/raw/install.sh | bash -s arg1 arg2
</syntaxhighlight>


* ...
== References ==


== Section 1 ==
* Stack Overflow: [https://stackoverflow.com/questions/5735666/execute-bash-script-from-url Execute bash script from URL]
...
* Ask Ubuntu: [https://askubuntu.com/questions/1086617/dev-fd-63-no-such-file-or-directory "/dev/fd/63 No such file or directory"]


<noinclude>
<noinclude>
Line 13: Line 17:
{{devStage  
{{devStage  
  | Прндл  = Linux Server
  | Прндл  = Linux Server
  | Стадий = 2
  | Стадий = 6
  | Фаза  = Разработване
  | Фаза  = Утвърждаване
  | Статус = Създаден
  | Статус = Утвърден
  | ИдтПт  = Spas
  | ИдтПт  = Spas
  | РзбПт  = {{REVISIONUSER}}
  | РзбПт = Spas
| АвтПт  = Spas
| УтвПт = {{REVISIONUSER}}
  | ИдтДт  = 28.09.2022
  | ИдтДт  = 28.09.2022
  | РзбДт  = {{Today}}
  | РзбДт = 28.09.2022
| АвтДт  = 28.09.2022
| УтвДт = {{Today}}
  | ИдтРв  = [[Special:Permalink/32026|32026]]
  | ИдтРв  = [[Special:Permalink/32026|32026]]
  | РзбРв  = {{REVISIONID}}
  | РзбРв = [[Special:Permalink/32052|32052]]
| АвтРв  = [[Special:Permalink/32054|32054]]
| РзАРв  = [[Special:Permalink/32049|32049]]
| УтвРв = {{REVISIONID}}
| РзУРв  = [[Special:Permalink/32051|32051]]
}}
}}
</div>
</div>
</noinclude>
</noinclude>

Latest revision as of 17:46, 28 September 2022

Ex­am­ple

The curl com­mand will fetch the in­stal­la­tion script from the repos­i­to­ry github​.com/​m​r​b​v​r​z​/​s​e​g​o​e​–​u​i​–​linux and by the help of the process sub­sti­tu­tion op­er­a­tor <(…) (which will be treat­ed as pseu­do-file) the out­put of curl will be ex­e­cut­ed via bash.

bash <(curl -s https://example.com/path-to/raw/install.sh)
curl -s https://example.com/path-to/raw/install.sh | bash -s arg1 arg2

Ref­er­ences