488889
243
Verklein
Vergroot
Pagina terug
1/284
Pagina verder
Before you can run this script you need some prerequisites:
1. Every script should contain a Shebang line (this is already the case with our ex-
ample above.) If a script does not have this line, you have to call the interpreter
manually.
2. You can save the script wherever you want. However, it is a good idea to save
it in a directory where the shell can nd it. The search path in a shell is determined
by the environment variable PATH. Usually a normal user does not have write
access to /usr/bin. Therefore it is recommended to save your scripts in the users'
directory ~/bin/. The above example gets the name hello.sh.
3. The script needs executable permissions. Set the permissions with the following
command:
chmod +x ~/bin/hello.sh
If you have fullled all of the above prerequisites, you can execute the script in the
following ways:
1. As Absolute Path The script can be executed with an absolute path. In our
case, it is ~/bin/hello.sh.
2.
Everywhere If the PATH environment variable contains the directory where the
script is located, you can execute the script just with hello.sh.
18.3 Redirecting Command Events
Each command can use three channels, either for input or output:
Standard Output This is the default output channel. Whenever a command
prints something, it uses the standard output channel.
Standard Input If a command needs input from users or other commands, it
uses this channel.
Standard Error Commands use this channel for error reporting.
To redirect these channels, there are the following possibilities:
Command > File
Saves the output of the command into a le, an existing le will be deleted. For
example, the ls command writes its output into the le listing.txt:
ls > listing.txt
Command >> File
Appends the output of the command to a le. For example, the ls command ap-
pends its output to the le listing.txt:
Bash and Bash Scripts 231
243

Hulp nodig? Stel uw vraag in het forum

Spelregels
1

Forum

Suse-openSUSE-12.2

Zoeken resetten

Misbruik melden

Gebruikershandleiding.com neemt misbruik van zijn services uitermate serieus. U kunt hieronder aangeven waarom deze vraag ongepast is. Wij controleren de vraag en zonodig wordt deze verwijderd.

Product:

Bijvoorbeeld antisemitische inhoud, racistische inhoud, of materiaal dat gewelddadige fysieke handelingen tot gevolg kan hebben.

Bijvoorbeeld een creditcardnummer, een persoonlijk identificatienummer, of een geheim adres. E-mailadressen en volledige namen worden niet als privégegevens beschouwd.

Spelregels forum

Om tot zinvolle vragen te komen hanteren wij de volgende spelregels:

Belangrijk! Als er een antwoord wordt gegeven op uw vraag, dan is het voor de gever van het antwoord nuttig om te weten als u er wel (of niet) mee geholpen bent! Wij vragen u dus ook te reageren op een antwoord.

Belangrijk! Antwoorden worden ook per e-mail naar abonnees gestuurd. Laat uw emailadres achter op deze site, zodat u op de hoogte blijft. U krijgt dan ook andere vragen en antwoorden te zien.

Abonneren

Abonneer u voor het ontvangen van emails voor uw Suse openSUSE 12.2 bij:


U ontvangt een email met instructies om u voor één of beide opties in te schrijven.


Ontvang uw handleiding per email

Vul uw emailadres in en ontvang de handleiding van Suse openSUSE 12.2 in de taal/talen: Engels als bijlage per email.

De handleiding is 14 mb groot.

 

U ontvangt de handleiding per email binnen enkele minuten. Als u geen email heeft ontvangen, dan heeft u waarschijnlijk een verkeerd emailadres ingevuld of is uw mailbox te vol. Daarnaast kan het zijn dat uw internetprovider een maximum heeft aan de grootte per email. Omdat hier een handleiding wordt meegestuurd, kan het voorkomen dat de email groter is dan toegestaan bij uw provider.

Stel vragen via chat aan uw handleiding

Stel uw vraag over deze PDF

loading

Andere handleiding(en) van Suse openSUSE 12.2

Suse openSUSE 12.2 Gebruiksaanwijzing - English - 530 pagina's


Uw handleiding is per email verstuurd. Controleer uw email

Als u niet binnen een kwartier uw email met handleiding ontvangen heeft, kan het zijn dat u een verkeerd emailadres heeft ingevuld of dat uw emailprovider een maximum grootte per email heeft ingesteld die kleiner is dan de grootte van de handleiding.

Er is een email naar u verstuurd om uw inschrijving definitief te maken.

Controleer uw email en volg de aanwijzingen op om uw inschrijving definitief te maken

U heeft geen emailadres opgegeven

Als u de handleiding per email wilt ontvangen, vul dan een geldig emailadres in.

Uw vraag is op deze pagina toegevoegd

Wilt u een email ontvangen bij een antwoord en/of nieuwe vragen? Vul dan hier uw emailadres in.



Info