Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data: I am trying to make a script called showtime that displays the current time for a given city.
The problem is on the error checking part im trying to make the script search a directory called zoneinfo to see if the region or city the user entered exist.
2. Relevant commands, code, scripts, algorithms:
# Declear Varables
region=$1
city=$2
#Checking if region exist in the database
region=$(ls ~/zoneinfo| grep '$1')
3. The attempts at a solution (include all code and scripts):
# Declear Varables
region=$1
city=$2
#Checking if region exist in the database
region=$(ls ~/zoneinfo| grep '$1')
if [ '$1' == "" ]; then
echo $1 does not exist
exit 2
fi
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):Seneca College professor name John selmy/course name OPS 435
your website wont let me post the url to the courses sit for some reason??
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
Moderator's Comments:
|
|
Please view this code tag video for how to use code tags when posting code and data.
|
|