Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

no been able to read the output

I’m not able to read the output from the cat/etc/issue and use it to check if you are using the tested distro for one of my tools

#!/bin/bash
cat /etc/issue 
read distro   
echo $distro
if [[ "$distro" = "Debian GNU/Linux bookworm/sid \n \l" ]];
then
 echo "You are using Debian"
else
 echo "you are not using Debian some things may not work"
fi

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

cat and read in your current script are completely independent.

Try read distro </etc/issue instead.

That said, grep is probably better suited to figure out if something contains a certain string, and /etc/os-release seems like a better source for what OS you’re running.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading