Article 54QK4 Bash Help

Bash Help

by
TBotNik
from LinuxQuestions.org on (#54QK4)
All,

Have this script to pull version from the system:

Code:for line in $lines; do
if [[ "$line" =~ "VERSION_ID=" ]]; then
ver=${line:11:5}
echo "$ver"
fi
done < cat "/etc/os-release"But it produces this error string:
Quote:
syntax error near unexpected token `"/etc/os-release"'
done < cat "/etc/os-release"'
By all the HOWTOs this is suppose to work, but since it says "syntax" gotta be something simple, right?

if it is obvious to you, please help!

Cheers!

TBNKlatest?d=yIl2AUoC8zA latest?i=Wrb72MVooE4:DZD0HuNPygI:F7zBnMy latest?i=Wrb72MVooE4:DZD0HuNPygI:V_sGLiP latest?d=qj6IDK7rITs latest?i=Wrb72MVooE4:DZD0HuNPygI:gIN9vFwWrb72MVooE4
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments