euglug.org

[작성자:] admin

  • [Eug-lug] size of files from a shell script, portably



    Jacob MeuserThu Dec 9 14:21:01 PST 2004

    On Thu, Dec 09, 2004 at 09:29:23AM -0800, Bob Miller wrote:
    > Jacob Meuser wrote:
    > 
    > > well, I didn't know about wc -c, thanks.  however, the output,
    > > at least on my system, is not easily parsable, as it is oddly
    > > aligned, with varying amounts of space.
    > 
    > If you use "wc -c < file" instead of "wc -c file" then wc
    > doesn't print the file name.
    
    ah, nice.  I was worried about the leading spaces as well, but printf
    seems to take care of that:
    
    $ tb=0; for i in *; do b=`wc -c < $i`; b=`printf "%d" $b`; \
    tb=`expr $tb + $b`; done; echo $tb
    
    -- 
    <jakemsr at jakemsr.com>
    
  • [Eug-lug] USB floppy follow-up



    Brian GallagherThu Dec 9 12:53:03 PST 2004

    Walter
    
    My bad.  Did you say that the USB floppy was working under Fedora for
    everything but WP8?
    
    I still stand by the confidence builder.  It will take you in the
    direction you want to go anyways.
    
    Brian
    -- 
    Message from Mars: got to get new reading glasses, getting old sucks!
    
    
  • [Eug-lug] USB floppy discussion



    Brian GallagherThu Dec 9 12:25:35 PST 2004

    Walter
    
    I am a Linux novice so treat my advice accordingly.  I have tried to
    follow the discussion but I am picking up email from several computers,
    so I may have missed something.
    
    A short digression: you are not "El stupido" you are working with
    cutting edge technology.  I sometimes use self-depreciating humor to
    break the ice, also.  No big E!
    
    My suggestion is to do a confidence builder: mount a USB jump drive.  I
    just performed this operation on my computer.  I had to fiddle with the
    line of code in /ect/fstab and make a file in /mnt but besides that it
    was relatively painless.  I, of course, made all the nubie mistakes: not
    in root, command line typos, you know the drill. 
    
    "I don't have a jump drive...I can't afford a jump drive!" you say.  
    
    We'll get you a drive for the purpose of this experiment!
    
    Is this a laptop?  The tight space and subsequent use of proprietary
    hardware on laptops can be counter to generic solutions offered for
    generic hardware on a stationary computer.  If this is a laptop I defer
    you to the other more technically inclined members of this group.  I am
    going to assume that you have Googled the world with this question: "my
    xyz computer will not work my xyz USB floppy under Fedora Core 2 using
    WP8."
    
    Brian
    -- 
    Message from Mars: long winded emails are seldom read completely
    
    
  • [Eug-lug] Meeting/Freak’n cable…



    Linux Rocks!Thu Dec 9 12:00:12 PST 2004

    So, my place should be ready for meeting... We could use chairs, as I have no 
    furnature to speak of. 
    I had internet working for the last month, however comcast managed to shut me 
    down. Ive gotten several excuses as to why... comcast requires you to use 
    internet explorer to configure your cable modem. After spending a few hours 
    on the phone, and installing mac os 9 on an old iMac, I managed to get the 
    internet back on. It was a big waste of time for me (about 4 hours total), 
    just to get things working again after comcast messed it up, so I figured I'd 
    tell everyone what a pain in the ass comcast is.
    
    Jamie
    
    
    -- 
    Now, it we had this sort of thing:
      yield -a     for yield to all traffic
      yield -t     for yield to trucks
      yield -f     for yield to people walking (yield foot)
      yield -d t*  for yield on days starting with t
    
    ...you'd have a lot of dead people at intersections, and traffic jams you
    wouldn't believe...
    	-- Discussion on the intuitiveness of commands
    
    
  • [Eug-lug] size of files from a shell script, portably



    Bob MillerThu Dec 9 09:29:23 PST 2004

    Jacob Meuser wrote:
    
    > well, I didn't know about wc -c, thanks.  however, the output,
    > at least on my system, is not easily parsable, as it is oddly
    > aligned, with varying amounts of space.
    
    If you use "wc -c < file" instead of "wc -c file" then wc
    doesn't print the file name.
    
    -- 
    Bob Miller                              K<bob>
    kbobsoft software consulting
    http://kbobsoft.com                     kbob at jogger-egg.com
    
  • [Eug-lug] size of files from a shell script, portably



    Jacob MeuserThu Dec 9 01:13:13 PST 2004

    On Thu, Dec 09, 2004 at 12:27:55AM -0800, horst wrote:
    > >Date: Wed, 8 Dec 2004 22:35:55 -0800
    > >From: Jacob Meuser <jakemsr at jakemsr.com>
    >  ...
    > >>others print the number of bytes.  Which did you want?
    > >
    > >bytes.  the files need to fit on a DVD.
    > >
    > 
    > I have no idea how universal wc is (though not efficient), but
    >  wc -c *.mp3
    > does the math for you.
    
    well, I didn't know about wc -c, thanks.  however, the output,
    at least on my system, is not easily parsable, as it is oddly
    aligned, with varying amounts of space.
    
    -- 
    <jakemsr at jakemsr.com>
    
    >  - Horst
    > 
    > P.S. In a few years python's function os.stat() will be as popular as 
    > perl's stat... but of course you'd expected such smelly footnote from my 
    > end :-)
    
    :)
    
  • [Eug-lug] size of files from a shell script, portably



    Bob MillerThu Dec 9 01:10:02 PST 2004

    horst wrote:
    
    > I have no idea how universal wc is (though not efficient), but
    >  wc -c *.mp3
    > does the math for you.
    
    Good idea.  wc (including the -c flag) is largely unchanged since at
    least 6th Edition Unix, circa 1975.  Probably longer.
    
    -- 
    Bob Miller                              K<bob>
    kbobsoft software consulting
    http://kbobsoft.com                     kbob at jogger-egg.com
    
  • [Eug-lug] size of files from a shell script, portably



    horstThu Dec 9 00:27:55 PST 2004

    > Date: Wed, 8 Dec 2004 22:35:55 -0800
    > From: Jacob Meuser <jakemsr at jakemsr.com>
      ...
    >> others print the number of bytes.  Which did you want?
    >
    > bytes.  the files need to fit on a DVD.
    >
    
    I have no idea how universal wc is (though not efficient), but
      wc -c *.mp3
    does the math for you.
    
      - Horst
    
    P.S. In a few years python's function os.stat() will be as popular as 
    perl's stat... but of course you'd expected such smelly footnote from my 
    end :-)
    
    
  • [Eug-lug] Re: Freak’n cable…



    bogan smytheWed Dec 8 23:00:40 PST 2004

    And the mind blow is that tens of millions of folks don't balk at spending
    the better part of 100 bux a month for this kind of thing.
    
    Any wonder bombast has so much loose capital, they're literally trying to
    buy the world?
    
    It's gauche to shop WalMart--but it's NOT gauche to support bombast?  
    
    Go figure . . .
    
    On 09-Dec-04, you wrote:
    
    > So, my place should be ready for meeting... We could use chairs, as I have
    > no furnature to speak of.
    > I had internet working for the last month, however comcast managed to shut
    > me down. Ive gotten several excuses as to why... comcast requires you to
    > use internet explorer to configure your cable modem. After spending a few
    > hours on the phone, and installing mac os 9 on an old iMac, I managed to
    > get the internet back on. It was a big waste of time for me (about 4 hours
    > total), just to get things working again after comcast messed it up, so I
    > figured I'd tell everyone what a pain in the ass comcast is.
    > 
    > Jamie
    > 
    > 
    Regards
    -- 
        http://world.lookscool.com
        http://www.efn.org/~mikemcoo
    
    "Did you know that in Antarctica,  nighttime temperatures can plunge to -120
    degrees?"
    
    "Yeah, but it's a DRY cold . . . "
    
    
    
  • [Eug-lug] size of files from a shell script, portably



    Jacob MeuserWed Dec 8 22:35:55 PST 2004

    On Wed, Dec 08, 2004 at 09:58:33PM -0800, Bob Miller wrote:
    > Jacob Meuser wrote:
    > 
    > > $subject is the question, is du (part of) the answer, or is there
    > > something better?
    > 
    >     du -k $file
    >     ls -l $file | awk '{print $5}'
    >     expr `stat --format="%b \* %B" $file`
    > 
    > I don't know if any of those are really portable very far off the
    > mainstream.  I've seen du commands that didn't support -k, ls commands
    > that didn't print the owning group by default, and the stat command
    > seems to be a GNU-only thing.
    
    ok, that about what I thought.
    
    > There's always perl, if you can rely on it being present...
    > 
    >     perl -e "@x = stat('$file'); "'print $x[7]'
    
    I may move the whole script to perl anyway, as I'm going to need a
    bunch of regex stuff.
    
    > Some of these print the number of blocks allocated for the file, and
    > others print the number of bytes.  Which did you want?
    
    bytes.  the files need to fit on a DVD.
    
    -- 
    <jakemsr at jakemsr.com>