LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-05-2003, 08:18 PM   #1
Bigun
Member
 
Registered: Aug 2002
Location: Hickville, TN
Distribution: Gentoo > current. Have used: Red Hat 7.3, 9, Gentoo 1.4
Posts: 400

Rep: Reputation: 30
Another script


This script I am building I would like to work like this. It "ls -l" multiple directories, and I want it to only list certain file types (yes I know, certain switches used with 'ls' will work, but I'm learning scripting here), and edit the rest out. So it will only list what I specify in the script. I've gotten so far as to list the files of directories and files I've masked, but it also lists any errors of any directories that don't exist, I would like to hide this, how would I do so?
 
Old 11-05-2003, 09:07 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
How about posting what you have so far. Also include an example of how you run the program and what you would and would not expect to see. I'm just not sure what you are asking for.
 
Old 11-05-2003, 09:33 PM   #3
Bigun
Member
 
Registered: Aug 2002
Location: Hickville, TN
Distribution: Gentoo > current. Have used: Red Hat 7.3, 9, Gentoo 1.4
Posts: 400

Original Poster
Rep: Reputation: 30
Well, I can give you this line for instance:

ls -l *.vps | grep rwxr-wr-w

And if there are no vps files, I want it to go on w/o wasting a line of output, but it does telling me there are no vps files, but with me scanning a ton of directories, a bunch of garbage errors will come out with useful data. How can I hide these error messages?
 
Old 11-05-2003, 10:12 PM   #4
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
How about this:
Code:
ls -l | grep "\.vps$"  | grep rwxr-wr-w
 
  


Reply



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
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 04:19 AM
Directory listing - Calling shell script from a CGI script seran Programming 6 08-11-2005 11:08 PM
creating shell script that executes as root regardless of who runs the script? m3kgt Linux - General 13 06-04-2004 10:23 PM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
linux 9 and java script error - premature end of script header sibil Linux - Newbie 0 01-06-2004 04:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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