Creating script which find the file with the less rows
I'm new to this forum and also new on Linux. I'm learning some script programming in Bash.
Like subject says I'm trying to write some script which will find the file which has the less rows. I want to pass directory as the argument to the script. In that directory I would like that my script will check all the files and than return the name of the file to me. If there will be no directory given, than script should return some kind of error (like echo "You forgot argument").
I guess its the easies way to solve this problem with two for loops (?!), but actualy don't know how to start.
I would love if anyone of your guys could help me with my problem.
Thanks in addition.
P.S: I'm sorry if my english is bad. If you didn't understand anything I can explain it again in a different way.