Note book to help you and me remember some tricks

Category shell script

Shell script function particularities: declare local variables, run in background, …

Run a function in background and get its process ID Instead of creating another script that you call from your primary script you can simply declare a function (inside your primary script or inside another file that you include), and… Continue Reading →

Shell script special variables ordered by frequency of used

$n Where n is a positive integer and takes values from 1 to a greater value not restricted. n correspond to the position of an argument givent to a script or to a function $? Exit status of the last… Continue Reading →

Why CRLF on Linux can sometimes be displayed as ^M with line feed?

Firstly, it’s good to remember these following points: (Some history: historically linefeed (LF) was used to advance the paper by one line on printers and hardcopy terminals (teleprinters); carriage return (CR) returned the print head to the start of the… Continue Reading →

Send an email on Linux with CLI or shell script without installing anything (no ssmtp required)

Prerequisites Basic example without encoding headers Case of an existing SMTP server without authentication (smtpserver.nicodevlog.com can be replaced by the domain name of your smtp server or its IP address): At the end you can see “\nSubject: TEST send mail… Continue Reading →

Shell script – Variables evaluation : display line endings \n and don’t cut your parameter function

How to pass string with several words and line endings \n as a parameter to a function Solution : Second test rst test : $myvar will be replaced by it’s value that contains a lot of words with spaces and… Continue Reading →

Newer posts »

© 2025 Software engineer >> Sysadmin >> Devops >> SRE — Powered by WordPress

Theme by Anders NorenUp ↑