LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Creating script which find the file with the less rows (https://www.linuxquestions.org/questions/linux-newbie-8/creating-script-which-find-the-file-with-the-less-rows-4175591523/)

NewGuy95 10-16-2016 06:16 AM

Creating script which find the file with the less rows
 
Hello,

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.

michaelk 10-17-2016 01:25 PM

Duplicate thread.

Continue here:
http://www.linuxquestions.org/questi...ry-4175591524/


All times are GMT -5. The time now is 12:28 PM.