7.8k views
5 votes
A 1-line script can be written that counts the number of words in two text files and compares the counts: IF [WC -w f1 -eq WC -w f2] THEN ECHO "equal" ELSE ECHO "not equal" Show the order in which the different tasks below must be performed to accomplish the same goal using a GUI.

User Mohsen TOA
by
6.2k points

1 Answer

5 votes

Answer:

Hi Salhumad! A GUI for comparing 2 files would have select buttons for choosing the 2 files and a "Compare" button to compare the 2 files once they have been selected.

Step-by-step explanation:

Your question is giving you most of the answer itself. The 1-line script counts the number of words in two text files and compares the results. Using a GUI, you would have a "select file" chooser button on one side of the screen to allow user to select the first file, and another "select file" button for the user to select the second file for comparison. Another button would be on the screen that would say "Compare files", which once you click, can invoke the one-line script already provided to you in the question. You can put error handling to only call the compare files code once both files are selected.

User Ruppesh Nalwaya
by
5.8k points