Module 2 milestone 4

echo $variable doesn’t give the value , even though it is present on the file?

maybe you are doing some syntax mistake practice or execute with basics in terminal then try to find out what syntax mistakes you are doing

I have used “ID” and “VERSION_ID” from the /etc/os-release. Is that right?

yeah but make sure it should be same as variables in script which are comparing with VERSION_ID and ID.
VERSION_ID is ok but in case of ID you can also able to use NAME.

I didnt undestand what you said?

Now its showing correct output in terminal saying “OS is Ubuntu which is required for QBox
Ubuntu version is 18 which is sufficient for QBox” . But failing on build saying “returncode>0 error”.
Please help, its my 8th build failure.

try using other parameters from os-release

i had same error, one of the parameter you are using while getting version and name is not installed in test server try doing another way.

Please use NAME and VERSION_ID.

generally speaking if I assign key value pairs( like dictionary) to a variable then how to extract a specific value of a key from that variable. Can I treat this variable like dictionary

are you talking about “bc” ?

Solved it. I was using “bc” for string manipulation and I think its not installed on the test server. Then , I used another approach and solved it.

1 Like

hey,how did u solve ur problem,i am having same issue

I have used VERSION_ID and NAME and have done all necessary arthmetic but still couldnt pass the assesment getting exitcode >0

Thanks in advance

I’m facing the same problem. I’m successfully able to print the name “Übuntu”,
but getting an “integer expression expected error”
though when is try printing using echo “$ubuntuVersion”, i’m getting 18.04 as output.

I am not able to get out put using $variablename, its just show new line. Any help?

How did you solve it??