Results 1 to 6 of 6

Thread: shell programming

Hybrid View

  1. #1
    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

  2. #2
    Join Date
    Nov 2006
    Location
    Seattle
    Posts
    305

    Default

    Maybe this... not sure what you are wanting:
    Code:
    ls | xargs file

  3. #3
    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.

  4. #4
    Join Date
    Nov 2006
    Location
    Seattle
    Posts
    305

    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).

  5. #5
    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.

  6. #6
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •