Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-20-2005, 01:12 PM   #1
LQ Newbie
Registered: Apr 2004
Location: AUSTRIA
Distribution: FC3
Posts: 14

Rep: Reputation: 0
This script in one line?

Hi all,

short question: How can I put this script in one line?
(just as I would type it in manually at bash (bourne again shell)

# Script used for listing only directories
dir -1 | while read a;
if test -d "$a"
echo "$a"

# dir -1 | .... ??? <--- ??

Thanks for help in advance,
would be great if anyone has good bash programming howto's.

Old 02-20-2005, 01:15 PM   #2
Registered: Jun 2003
Location: Denver, CO
Distribution: Debian
Posts: 95

Rep: Reputation: 15
ls -l | grep ^d


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
bash shell script read file line by line. Darren[UoW] Programming 57 04-17-2016 07:07 PM
end of line script paul_mat Linux - Software 1 11-04-2005 02:06 AM
Need quick 1-line script help. mehesque Linux - Software 2 08-24-2005 03:18 PM
Loop line by line script twantrd Programming 7 01-17-2005 12:47 AM
/r at end of line in script silence Linux - General 1 08-21-2004 09:25 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:51 PM.

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