Quire

Shell-script és un llenguatge de programació que funciona en els sistemes Linux i Mac. La seva extensió és .sh (shell script). El llenguatge va ser dissenyat per Linus Torvalds, el creador dels sistemes Linux.[1][2][3]

Estructura bàsica#edit

Un arxiu shell-script ha de tenir la següent estructura:

#!/bin/bash
// Comentari 1
# Comentari 2
var=1;
echo $var
math=$(($var*2))
echo $math

La seva sortida seria:

1
2

Referències#edit

  1. ^ Kernighan, Brian W. & Pike, Rob (1984), "3. Using the Shell", The UNIX Programming Environment, Prentice Hall, Inc., p. 94, ISBN 0-13-937699-2
  2. ^ Arnold Robbins and Nelson H.F. Beebe. Classic Shell Scripting. O'Reilly Media, 2005, p. 5. ISBN 978-0-596-00595-5.
  3. ^ Johnson, Chris. Pro Bash Programming: Scripting the Linux Shell. Apress, 2009. ISBN 9781430219989.

This article is mirrored from “Shell script” on Català Wikipedia, revision 36674667, written by Wikipedia's contributors and licensed CC BY-SA 4.0. Editing it here creates a Quire copy with its own history.

Synced with Wikipedia revision 36674667 · just now