Can you see what the problem or what went wrong with this file.sh , shel linux script. They show in the terminal when I run it : ./test.sh: line 70: syntax error: unexpected end of file.    test.sh: while true; do case "$action" in "1") echo echo "<<-Lasses Logistik och Logik->>" cat data.txt echo "<<---End-of-file--->>" echo;; "2") echo "Sort the file by column: " echo "choose from below to sort" echo "i | n | v | l | b | h" read input ID_colnum=1 Name_column=2 Vikt_column=3 L_column=4 B_column=5 H_column=6 case $input in "i")head -n 1 data.txt && tail -n +2 data.txt | sort -k $ID_colnum;; "n")head -n 1 data.txt && tail -n +2 data.txt | sort -k $Name_column;; "v")head -n 1 data.txt && tail -n +2 data.txt | sort -k $Vikt_column;; "l")head -n 1 data.txt && tail -n +2 data.txt | sort -k $L_column;; "b")head -n 1 data.txt && tail -n +2 data.txt | sort -k $B_column;; "h")head -n 1 data.txt && tail -n +2 data.txt | sort -k $H_column;; "3") echo "Enter phone number to delete: " backup_files="data.txt" dest="/home/arwakhaddour/Documents/OPSY" day=$(date +%A) hostname=$(hostname -s) archive_file="$hostname-$day.tgz" echo "Backing up $backup_files to $dest/$archive_file" date echo tar czf $dest/$archive_file $backup_files echo echo "Backup finished" date echo;; "x") exit 0;; "X") exit 0;; esac echo "<< Lasses Logistik och Logik>>" echo echo "<1>. print the file " echo echo "<2>. Sort the file " echo echo "<3>. Backup" echo echo ". Exit program" echo echo "Enter your selection <1-3, x>:" read action esac   data.txt: The textfile : ID    Name     Vikt          L     B       H 012   Eric         56       156     7       13 045  Richard    78       178    9        17 098   Maya      60       164    10      16 072   Anna      56       152      8      14 034  Helena    76       169      11    18 022  Kevin       66       162      6      12 093  Peter       99        170     12     19

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Can you see what the problem or what went wrong with this file.sh , shel linux script. They show in the terminal when I run it : ./test.sh: line 70: syntax error: unexpected end of file. 

 

test.sh:

while true;
do
case "$action" in
"1") echo
echo "<<-Lasses Logistik och Logik->>"
cat data.txt
echo "<<---End-of-file--->>"
echo;;

"2") echo "Sort the file by column: "
echo "choose from below to sort"
echo "i | n | v | l | b | h"
read input
ID_colnum=1
Name_column=2
Vikt_column=3
L_column=4
B_column=5
H_column=6
case $input in
"i")head -n 1 data.txt && tail -n +2 data.txt | sort -k $ID_colnum;;
"n")head -n 1 data.txt && tail -n +2 data.txt | sort -k $Name_column;;
"v")head -n 1 data.txt && tail -n +2 data.txt | sort -k $Vikt_column;;
"l")head -n 1 data.txt && tail -n +2 data.txt | sort -k $L_column;;
"b")head -n 1 data.txt && tail -n +2 data.txt | sort -k $B_column;;
"h")head -n 1 data.txt && tail -n +2 data.txt | sort -k $H_column;;





"3") echo "Enter phone number to delete: "
backup_files="data.txt"
dest="/home/arwakhaddour/Documents/OPSY"
day=$(date +%A)
hostname=$(hostname -s)
archive_file="$hostname-$day.tgz"
echo "Backing up $backup_files to $dest/$archive_file"
date
echo
tar czf $dest/$archive_file $backup_files
echo
echo "Backup finished"
date
echo;;

"x") exit 0;;
"X") exit 0;;
esac
echo "<< Lasses Logistik och Logik>>"
echo
echo "<1>. print the file "
echo
echo "<2>. Sort the file "
echo
echo "<3>. Backup"
echo


echo "<x>. Exit program"
echo
echo "Enter your selection <1-3, x>:"
read action
esac

 

data.txt:

The textfile :

ID    Name     Vikt          L     B       H
012   Eric         56       156     7       13
045  Richard    78       178    9        17
098   Maya      60       164    10      16
072   Anna      56       152      8      14
034  Helena    76       169      11    18
022  Kevin       66       162      6      12
093  Peter       99        170     12     19

Expert Solution
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY