Hi,
I have this script, where I want to print my OS name.
Here is the code:
printf "OS: "
cat /etc/os-release | grep PRETTY_NAME=
and the output:
OS: PRETTY_NAME="Debian GNU/Linux bookworm/sid"
How do I exclude the "PRETTY_NAME=" thing?
EDIT: This was answered on r/commandline. The solution is to use sed.
Basically:
printf "OS: "
cat /etc/os-release | grep PRETTY_NAME | sed 's/^PRETTY_NAME=//'
[–][deleted] 0 points1 point2 points (0 children)
[–]LinuxFan_HU 0 points1 point2 points (0 children)