Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
- The problem statement, all variables and given/known data:
You will write a script that will remove all HTML tags from an HTML document and remove any consecutive duplicate lines, and save it as a text document. The user should have the option of including the name of an html file as an argument for the script, but if none is provided, then the script should prompt the user for the file name.
Something is wrong with this script I just can't figure out what it is. It says it can't find the file yet it exists. I also have no clue how to direct the updated file to a new text document properly.
-
Relevant commands, code, scripts, algorithms:
-
The attempts at a solution (include all code and scripts):
cd ~
read -p "What file would you like to clean? " html
if [ -f $html ]
then
sed 's/<[^>]*>//g' $html | uniq > syllabus.html.txt
else
echo "File does not exist."
fi
- Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Jackson Community College, Jackson MI, USA, M. Brinkman, CIS106
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).