The UNIX and Linux Forums
Forum Home
Linux and Unix Man Pages
Search Forums
Search Community Posts
Today's Posts
Quick Links
Man Pages
RedHat Commands
OpenSolaris Commands
Linux Commands
SunOS Commands
FreeBSD Commands
All UNIX Man Pages
All Linux Man Pages
Full Man Repository
Login or Register to Ask a Question and Join Our Community
Search Forums
Show Threads .
Show Posts
Tag Search
Advanced Search
Quick Links
Contact Us
Forum Rules
Today's Posts
FAQ
Pictures & Albums
All Albums
Miscellaneous
What is My IP
Whois
Mark Forums Read
UNIX for Dummies Questions & Answers
Help with ls
Tags
beginners
Thread Tools
Search this Thread
Top Forums
UNIX for Dummies Questions & Answers
Help with ls
#
1
09-13-2007
Felix2511
Registered User
20,
0
Join Date: May 2007
Last Activity: 5 October 2009, 8:46 AM EDT
Location: Madrid,Spain
Posts: 20
Thanks Given: 0
Thanked 0 Times in 0 Posts
Help with ls
Hello:
How could I avoid that ls-command returns an error when there are no files to list?
ls path/*.DEL
Thank you in advance.
Felix2511
View Public Profile for Felix2511
Find all posts by Felix2511
#
2
09-13-2007
vino
Registered User
2,848,
14
Join Date: Feb 2005
Last Activity: 10 August 2018, 5:24 AM EDT
Location: Sydney, Down Under
Posts: 2,848
Thanks Given: 0
Thanked 14 Times in 14 Posts
Redirect the error output to /dev/null i.e.
Code
:
ls path/*.DEL 2> /dev/null
vino
View Public Profile for vino
Find all posts by vino
#
3
09-13-2007
Felix2511
Registered User
20,
0
Join Date: May 2007
Last Activity: 5 October 2009, 8:46 AM EDT
Location: Madrid,Spain
Posts: 20
Thanks Given: 0
Thanked 0 Times in 0 Posts
Thank you vino but the ls is in a for-file-in loop.
Sorry that i didn't mention it in my post.
Felix2511
View Public Profile for Felix2511
Find all posts by Felix2511
#
4
09-13-2007
vino
Registered User
2,848,
14
Join Date: Feb 2005
Last Activity: 10 August 2018, 5:24 AM EDT
Location: Sydney, Down Under
Posts: 2,848
Thanks Given: 0
Thanked 14 Times in 14 Posts
Excuse me for asking. What happens if it is in a for loop ?
vino
View Public Profile for vino
Find all posts by vino
Login or Register to Ask a Question
Previous Thread
|
Next Thread
Login or Register to Ask a Question
Member Badges and Information Modal
×