KandZ – Tuts

We like to help…!

Linux CLI 55 ๐Ÿง shell scripts output text

a - echo in shell scripts
echo command in shell scripting is a fundamental tool for outputting text or variables
echo "Hello, World!" โ†’ prints Hello World
echo $greeting โ†’ prints the content of $greeting variable
you can use escape characters as well
echo "This is a newline:\nAnd this is a tab:\t." โ†’ using tab escape character
-n option avoids new line
echo -n "Hello, " โ†’ avoids new line

b - printf and here document in shell scripts
printf offers more precise control over the output format
printf "Name: %s\nAge: %d\n" "$name" "$age" โ†’ formating text with printf
printf "%.2f\n" "$number" โ†’ Output will be "123.46"
Here documents are a way to pass multi-line text input into commands or scripts.
This is particularly useful for passing large blocks of text or SQL queries.
example 1 โ†’ multiline example
example 2 โ†’ use of variables example

Stop using slow, ad-bloated tool sites! ๐Ÿคฎ

๐Ÿ”Ž Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
โœ… Finance (Mortgage, Interest, Inflation)
โœ… Tech (Base64, JSON, Dev Suite, IP)
โœ… Health (BMI, BMR, TDEE)
โœ… Productivity (Timer, Workspace, QR)

โšก๏ธ Fast & Private
๐Ÿ”’ No data leaves your device
๐Ÿ’Ž 100% Free

๐Ÿ”— Use it now: https://tools.kandz.me
๐Ÿ”– Bookmark itโ€”youโ€™ll need it later!

Leave a Reply