Hello everyone.
I need to write a script and I'm newbie in it.
Sorry for my English, I've been learning that amazing language for one year.
Task:
Write script called 'myls', "wrapper" program call ls in such a way that you could ask it the name of the file without extension, for example: you should write 'myls main' instead of 'ls main.c'. The script should first check if there is a file of exacly that name, and if so, call the program ls with it directly.
If the file doesn't exist, the script should try to make up the name of the file from a predefined list EXTENSIONS=".c .java .html" and if one of them adjusts to the existing file, invoke ls with appropriately name.
You can't call program ls with the name of a nonexistent file.
You can't use programs like: grep, sed, awk, tr.
I really appreciate any help you can provide.