Nieuws:

Welkom, Gast. Alsjeblieft inloggen of registreren.
Heb je de activerings-mail niet ontvangen?

Auteur Topic: Bash: Wat het verschil is tussen $( ) en ${ } en de structuur er binnenin?  (gelezen 1216 keer)

Offline bart85

  • Lid
Soms zoek ik op internet voorbeelden van code. Daar kom ik dan deze 2 structuren tegen $(  ) en ${  }.
Wat is het verschil tussen beide. Wat is de structuur er binnenin?, Welke mogelijkheden heeft het?
In een script kwam ik tegen het woord basename binnen $(  ). Welke woorden zijn er nog meer die binnen een van deze twee vormen een betekenis hebben?
Je leert maar mooi over weg gaan met de commandline.
Linus: "I'm happy with the people who are wandering around looking at the stars but I am looking at the ground and I want to fix the pothole before I fall in."
I look to the clouds behind me and see the thunder coming.

Heel kort door de bocht: $() verwacht een commando, ${} een variabele.

Voor {} : http://tldp.org/LDP/abs/html/parameter-substitution.html
Voor () : http://tldp.org/LDP/abs/html/commandsub.html

Offline bart85

  • Lid
De commando's die ik kan gebruiken, zijn dat alle programma's met output naar de commandline?
Je leert maar mooi over weg gaan met de commandline.
Linus: "I'm happy with the people who are wandering around looking at the stars but I am looking at the ground and I want to fix the pothole before I fall in."
I look to the clouds behind me and see the thunder coming.