Keys Pressed:
<ctrl+r> s <enter>
The ssh command has been used many times, so it's stored in my bash history. With a simple search for s
, I'm able to access that command.
Keys Pressed:
git clone <cmd+v> <enter>
(Repo URL was already in clipboard)
I typed out git clone and then pasted the already copied repository URL to speed up the process.
Keys Pressed:
cd l <tab> <enter>
<ctrl+r> javac - <enter>
<ctrl+r> java - <enter>
The first line becomes cd lab7/
. Tabbing allows bash to autocomplete the directory that I change into.
The second and third lines search for bash history for the javac
and java
commands with the correct classpath respectively.
They become: javac -cp .:lib/hamcrest-core-1.3.jar:lib/junit-4.13.2.jar *.java
and java -cp .:lib/hamcrest-core-1.3.jar:lib/junit-4.13.2.jar org.junit.runner.JUnitCore ListExamplesTests
respectively.
Keys Pressed:
nano Li <tab> .j <tab> <enter>
<ctrl+w> while (index2 <enter>
<down>
2 times, <right>
8 times
<backspace> 2
<ctrl+o> <enter> <ctrl+x>
The first line becomes nano ListExamples.java
. I allow for bash to autocomplete the file for me; it first completes to ListExamples
, since there is also a ListExamples.class
file in the directory. Then, I clarify with ListExamples.j
which is unique.
Next, I search for while(index2
in the file and fix the buggy line that may create an infinite while loop.
Then, using <ctrl+o> <enter>
I save the file and leave the nano editor with <ctrl+x>
Keys Pressed:
javac L <tab> .j <tab> <enter>
<up>
x3 <enter>
I compile the newly editted file with the javac
command; similarly to before, I allow bash to autocomplete ListExamples.java
. The whole command is javac ListExamples.java
Since we just ran the java -cp
command earlier to run the Tester file, we can directly go back in our history to run it by pressing the <up>
arrow keys. It should be: java -cp .:lib/hamcrest-core-1.3.jar:lib/junit-4.13.2.jar org.junit.runner.JUnitCore ListExamplesTests
Keys Pressed:
git add L <tab> .j <tab> <enter>
git commit -m “fixed” <enter>
git push <enter>
Once again, I allow bash to autocomplete ListExamples.java
, which makes the first line git add ListExamples.java
.
Then, I commit the added file with the message "fixed"
.
Finally, I push the commit to GitHub with git push
.