Answer to Question #255993 in UNIX/Linux Programming for Kar

Question #255993
Write a script to print the result "youngster" if you are age between 20 to 40. Hunt ( age >20 && age < 40 )
1
Expert's answer
2021-10-26T05:09:22-0400
# Write a script to print the result "youngster" 
# if you are age between 20 to 40. Hunt ( age >20 && age < 40 )

if [[ $# != "1" ]]; then
  echo "Usage: $0 age"
  exit 1
fi

age=$1

if [[ "$age" -ge 20 && ("$age" -le 40) ]]; then
  echo "youngster"
fi

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS