<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>einde on Notities</title><link>https://www.vandenboom.icu/en/tags/einde/</link><description>Recent content in einde on Notities</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Wed, 31 Jan 2024 20:18:39 +0000</lastBuildDate><atom:link href="https://www.vandenboom.icu/en/tags/einde/index.xml" rel="self" type="application/rss+xml"/><item><title>Bash script with a SUCCESS or FAILED message at the end of the line</title><link>https://www.vandenboom.icu/en/blog/2024-bash-script-met-een-succes-of-failed-melding-aan-het-einde-van-de-regel/</link><pubDate>Wed, 31 Jan 2024 20:18:39 +0000</pubDate><guid>https://www.vandenboom.icu/en/blog/2024-bash-script-met-een-succes-of-failed-melding-aan-het-einde-van-de-regel/</guid><description>See below an example script to display a SUCCESS message in green or a FAILED message in red, right-aligned at the end of the line.
#!/bin/bash # Set the message success_message=&amp;#34;Your command was successful&amp;#34; failed_message=&amp;#34;Your command failed&amp;#34; # Set the &amp;#34;OK&amp;#34; string in green ok=&amp;#34;$(tput setaf 2)[SUCCES]$(tput sgr0)&amp;#34; failed=&amp;#34;$(tput setaf 1)[FAILED]$(tput sgr0)&amp;#34; # Get the width of the terminal term_width=$(tput cols)+9 # Calculate the number of dots needed success_dots_count=$((term_width - ${#success_message} - ${#ok})) failed_dots_count=$((term_width - ${#failed_message} - ${#failed})) # Create a string of dots for success and failed messages success_dots=$(printf &amp;#34;%0.</description></item></channel></rss>