Phoronix Forums  

Go Back   Phoronix Forums > Software > Desktop Linux

Desktop Linux Discussion of Linux on the desktop.

Reply
 
Thread Tools Display Modes
  #1  
Old 12-18-2006, 01:43 AM
WildHeart WildHeart is offline
Junior Member
 
Join Date: Dec 2006
Posts: 4
Default shell programming

hey everyone howz it oging? am a complete noooooooooob to shell programming. i saw a few codes and applications and i already feel like running away lol i like my programming but with like java, vb, vb.net and even C++ but this hear looks all too new for me. so i decided i'd take it step by step like in java, the first prg they teach u is how to print HELLO WORLD so i do the same in bash. ok so here's my prb. say am in a directory and i want to find out how man files are jpegs and exe. like the result would b cout<<u have 10 jpegs and 5 exe
how do i get the name of a file and how do i check if it's an exe or not? a jpeg or not?
can someone just write a loop for this? a few lines checking if files are jpeg or not. no it's not an assignment although if u find it somewhere plz tell me lol cuz i'd rather read about it then ask
anything u can offer be it a complete answer or link or anything would b most appreciated. thnx and good day ^_^

ps. i think i put this in the wrong place but i wasnt so sure. sorry. didnt know if it were here or in general linux and id idnt want to double post on my first day lol
Reply With Quote
  #2  
Old 12-18-2006, 09:22 AM
joshuapurcell joshuapurcell is offline
Senior Member
 
Join Date: Nov 2006
Location: Dallas
Posts: 285
Default

Maybe this... not sure what you are wanting:
Code:
ls | xargs file
Reply With Quote
  #3  
Old 12-18-2006, 09:29 AM
WildHeart WildHeart is offline
Junior Member
 
Join Date: Dec 2006
Posts: 4
Default

well i'll check when i get back home. hey do u go online often? wildheart20yea@hotmail.com aliendevils@yahoo.com
mayb we can chat then and talk about this. am out right helping some friends with work. thnx for the reply. hope i get to talk to ya online soon.
Reply With Quote
  #4  
Old 12-18-2006, 12:54 PM
joshuapurcell joshuapurcell is offline
Senior Member
 
Join Date: Nov 2006
Location: Dallas
Posts: 285
Default

Better yet just use file without ls. Go to any directory you are interested in and type:
Code:
file *
Add a | grep -v directory to the end to only get a list of files (instead of files and directories). I'm online, but the easiest way to communicate is right here through these forums since I never know when I'll be on. Responding to posts is easy and can happen at any time (especially since I'm at work most of the day).
Reply With Quote
  #5  
Old 12-19-2006, 12:28 AM
WildHeart WildHeart is offline
Junior Member
 
Join Date: Dec 2006
Posts: 4
Default

ok thnx a lot for ur help. as soon as iget back home i'll get on and see if u'r there. thnx again i look fwd to this.
Reply With Quote
  #6  
Old 12-27-2006, 05:19 PM
WildHeart WildHeart is offline
Junior Member
 
Join Date: Dec 2006
Posts: 4
Default

hey howz it going? i tried to pm u but i got no reply. i just got back. been hard. merry christmas. so umm i hope u reply back cuz i finally am back to my good ol beautiful pc and i got access now. still havent forgotten about my linux prb. how u too
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:15 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2009 by Phoronix Media.