Informatics1-2018/HW2
A MathWikiből
(Változatok közti eltérés)
a (→Deadline) |
a (→Bash) |
||
7. sor: | 7. sor: | ||
* enter that directory ('''cd''') | * enter that directory ('''cd''') | ||
* download the file <tt>http://math.bme.hu/~borbely/felsobb_mat.random</tt> in the current directory ('''wget''') | * download the file <tt>http://math.bme.hu/~borbely/felsobb_mat.random</tt> in the current directory ('''wget''') | ||
− | * count the | + | * count the words in that file ('''wc''') and write it in a file <tt>lines.txt</tt> (''redirecting'') |
* erase the downloaded file ('''rm''') | * erase the downloaded file ('''rm''') | ||
* finally, enter the parent directory (back to home folder) | * finally, enter the parent directory (back to home folder) | ||
17. sor: | 17. sor: | ||
bash >>something.sh<< | bash >>something.sh<< | ||
+ | == Hint == | ||
+ | See the manuals like: | ||
+ | |||
+ | man cd | ||
+ | man wc | ||
+ | man ... | ||
== Deadline == | == Deadline == |
A lap 2018. szeptember 17., 11:36-kori változata
Tartalomjegyzék |
Bash
You have to write a bash script: write commands into a file, similar like the ones in konsole. The commands should do the following:
- Make a directory called Info1 in the home folder (mkdir)
- enter that directory (cd)
- download the file http://math.bme.hu/~borbely/felsobb_mat.random in the current directory (wget)
- count the words in that file (wc) and write it in a file lines.txt (redirecting)
- erase the downloaded file (rm)
- finally, enter the parent directory (back to home folder)
script
You can try the commands in konsole, and write them in a file with extension .sh, attach the .sh file to your email.
You can execute the commands in the file at once with bash
bash >>something.sh<<
Hint
See the manuals like:
man cd man wc man ...
Deadline
2018. September 23. 23:59
Points
- If your commands fail, you get 0 points.
- If your commands work but do something else that the task then you get 1 or 2 points.
- Perfect solution is 3 points.