LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 10-16-2016, 07:16 AM   #1
NewGuy95
LQ Newbie
 
Registered: Oct 2016
Posts: 14

Rep: Reputation: Disabled
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.
 
Old 10-17-2016, 02:25 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,340

Rep: Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146
Duplicate thread.

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


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find the file with the less rows in directory NewGuy95 Linux - Newbie 30 10-18-2016 04:50 AM
how to find match between two rows of column in same file using PERL genetist Linux - Newbie 3 07-13-2013 12:17 PM
Bash script help - removing certain rows from .csv file MrTuxor Programming 10 04-25-2013 12:47 PM
Script to convert words in a text file [columns to rows] naveenchandar Linux - Newbie 2 11-08-2012 02:00 AM
[SOLVED] Creating columns from every 4 rows kbensch Linux - General 7 05-19-2012 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration