AnyCompiler

Bash Ka Introduction

Bash ek shell scripting language hai — yeh zyada tar Linux systems par interactive command line hai, aur ek language bhi hai scripts likhne ke liye jo wohi commands automate karte hain jo aap hath se type karte hain. Is site ki har dusri language se alag, Bash mein static type system bilkul nahi hota: har variable by default ek string hoti hai, aur kisi value ko number treat karna sirf kuch specific contexts mein matter karta hai, jaise arithmetic expressions ke andar.

Bash ki dusri defining feature hai exit code: har ek command — sirf functions nahi — ek status number return kar ke finish hoti hai, 0 se 255 tak. Convention ke mutabiq 0 ka matlab success hai aur kuch bhi aur failure, jo ek typed language mein boolean true ke kaam karne ke tareeke se bilkul opposite hai. Yeh course yeh sab cover karta hai, sath mein arrays, string manipulation ke liye parameter expansion, pipes aur redirection, aur woh strict-mode flags jo Bash ko mistakes ke liye kam forgiving banate hain.

Ek Jhalak

Yeh hai ek real Bash script, jo is page ke apne interpreter par waqai execute hui hai — koi mockup nahi:

echo "Bash: a shell scripting language -- interpreted, not compiled, with exit codes instead of typed return values."
Output
Bash: a shell scripting language -- interpreted, not compiled, with exit codes instead of typed return values.

Sirf ek single command — koi function nahi, koi class nahi, pehle declare karne ko kuch nahi. Agla lesson aap ki pehli full script run karta hai aur exactly explain karta hai ke kya ho raha hai.

Practice exercise

Exactly yeh print karein: Bash runs scripts, not programs.