LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 11-14-2007, 08:39 PM   #1
_ AsiF
Member
 
Registered: Nov 2006
Location: Malaysia
Posts: 47

Rep: Reputation: 15
Script Hlp PLz !


HelpPLllzzzz ,

When I run the following shell script,, it gives an output like this :
"148" or "48". Just a number only ...

Wot does this mean ? Wot this script supposed to do ?

//---

DIRNAME=/usr/bin
FILETYPE="Shell script"
LOGFILE=logfile

file "$DIRNAME"/* | fgrep "$FILETYPE" | tee $LOGFILE | wc -l

exit 0

//---


Tnx guyz !

Last edited by _ AsiF; 11-14-2007 at 08:43 PM.
 
Old 11-15-2007, 09:43 AM   #2
lsteacke
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 99

Rep: Reputation: 16
It appears to just be counting how many words exist in the directory /usr/bin with the filetype shell script

Last edited by lsteacke; 11-15-2007 at 10:06 AM.
 
Old 11-15-2007, 09:59 AM   #3
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,503

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Quote:
Originally Posted by _ AsiF View Post
Wot does this mean ? Wot this script supposed to do ?
You can try to figure it out looking at the man pages of every single command. You can also try to execute the pipe stream adding one command at a time to see the partial results. Finally, you'll discover that it counts the number of shell scripts in the directory /usr/bin and put a list of them in the file "logfile".
 
Old 11-15-2007, 10:05 AM   #4
lsteacke
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 99

Rep: Reputation: 16
Oh ya and pipes it to logfile

Last edited by lsteacke; 11-15-2007 at 10:06 AM.
 
Old 11-16-2007, 07:26 PM   #5
_ AsiF
Member
 
Registered: Nov 2006
Location: Malaysia
Posts: 47

Original Poster
Rep: Reputation: 15
Tnx Guys , Thnx Very Much !!
 
  


Reply


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
2 audio out sources..... plz hlp chunkeydelight Linux - General 1 04-22-2006 10:56 PM
Window Decoration - hlp plz Oxyacetylene Linux - Software 7 12-08-2004 06:26 PM
The Fourth and Final Step... Plz Hlp kaz4u2dig Linux - Newbie 4 05-05-2004 12:22 AM
Audio being a payne...Plz hlp! aero_77 Linux - General 2 07-23-2003 08:40 AM
Audio being a payne...Plz hlp! aero_77 Linux - Hardware 1 07-23-2003 02:45 AM


All times are GMT -5. The time now is 01:33 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration