From the course: Learning Linux Shell Scripting
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Solution: Display a variable - Linux Tutorial
From the course: Learning Linux Shell Scripting
Solution: Display a variable
- [Instructor] Hopefully this wasn't too difficult. Here is my solution to the challenge. We do a touch env.sh, change mode 755 env.sh and finally, atom env.sh. Enter the shebang, usr/bin/env bash and print out our one long sentence, echo the computer's name is $HOSTNAME, the user's name is $USER and the home directory is $HOME and then we do an exit 0 and do a control S to save. Go back to the terminal, /env.sh and we get the computer's name, the user's name and the home directory and that's it for that challenge.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.