Find the answer to your Linux question:
Results 1 to 3 of 3
Could someone help me in shortening the following bash script to one command without piping. Code: for i in `ls -la | awk '{print $9}' | grep -v lvx-frotix-pcs`; do ...
  1. #1
    Just Joined!
    Join Date
    Jun 2011
    Posts
    1

    Exclamation Pls shorten the following code

    Could someone help me in shortening the following bash script to one command without piping.

    Code:
    for i in `ls -la | awk '{print $9}' | grep -v lvx-frotix-pcs`; do grep -e "number" $i; done | grep -v ^# | awk '{print }'
    It would help me a lot!
    Thanks!

  2. #2
    Trusted Penguin Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,392
    Quote Originally Posted by dzerueé View Post
    It would help me a lot!
    Thanks!
    It would help you a lot with your homework? May I refer you to the forum rules...
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Just Joined!
    Join Date
    Jan 2009
    Posts
    8
    This sounds like a school question

    Have you tried breaking out the peices to learn what it's doing? That's really the first step to cleaning this up. I can tell you right off that it's a blatently complex way of doing something simple, so I assume it's some kind of test or something.

    Swill

Posting Permissions

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