euglug.org

[작성자:] admin

  • [Eug-lug] Subject: Copying, moving, whatever… using wildcards in destination : wc2fn.py



    Hal PomeranzTue Nov 2 07:24:42 PST 2004

    > Sorry, but I would consider you as one of the 'distinguished veterans of 
    > regular expressions' as referred to in my original message (hey, accept it 
    > or not  --  it's  not a bad sticker :-)
    
    Absolutely.  The Perl program is really only usable by people who know
    enough Perl to get the "transformation code" argument syntactically
    correct "on-the-fly".  Basically, the program gives additional leverage
    to people who are already experienced Perl programmers (and even sombody
    with 12+ years of Perl experience like me wanted the "-n" switch), but
    I wouldn't just hand it to a newbie and tell them to have at it.
    
    >  Now how would you transfer the perl's 'rename' to a perl's 'copy' (using 
    > destination replacement), or to a perl's anyThing source-to-destination ?
    
    You end up having slightly different tools.  Oh, I suppose I could add
    a "-c" flag that does copy instead of rename, and "-s" to make symlinks,
    etc.  But if you want to fall back into the "Unix design religion" 
    argument from earlier posts (and I don't really), I'd say you'd create
    different tools.
    
    Another alternative would be to use the normal "cp" command to make a
    copy of the files with their original name, and then use the Perl
    "rename" to rename the files in the directory where you made the copy.
    "There's more than one way to do it"-- originally a Perl motto, but
    applicable to most things in Unix.
    
    > I may have made a mistake (=offending people), by pushing python as a 
    > language to implement such a tool... Hey, if your favorite language has  a 
    > better/different implementation, let us know !
    
    The question with any tool is (a) does it do what you want it to do,
    and (b) is it maintainable?  If yes to both, then don't spend time
    agonizing about whether you made the "right" choice.
    
    Like Stallman says, "free software" also means freedom to choose.  I
    groove on Perl because it was what was available when I needed a
    scripting language that was more powerful than sh/awk.  I've lately
    been pondering switching to Python if only because Perl 6 looks like
    it's going to be a very different language than the "classic Perl" I
    grew up with.
    
    -- 
    Hal Pomeranz, Founder/CEO      Deer Run Associates      hal at deer-run.com
        Network Connectivity and Security, Systems Management, Training
    
  • [Eug-lug] Configuring KDE



    SteveTue Nov 2 04:59:57 PST 2004

    On Mon, 2004-11-01 at 20:47, Allen Brown wrote:
    > That didn't do it.  But thank you for the suggestion.  It was
    > worth a try.
    > --
    > Allen Brown
    
    Well, what your asking isn't a new question. Here's a post that I pulled
    off of the Mandrake list, it should work here too though. Check it out:
    
    "go to Configure your Desktop (IE: KDE Kontrol Center **kcontrol**).
    it's in kicker->system->configuration. go to components->file
    associations. type html in the "find file name pattern" box. click on
    the html entry. under the "general" tab, look down at "application
    preference order". Mozilla should be listed there. click on it, then
    click the "move up" button 'til it's at the top of the list. click
    "apply".
    
    should Mozilla not be in the list, click the "add" button & browse to
    the Mozilla binary to add it. it's at /usr/bin/mozilla."
    
    Google on kde default browser, there are a few other suggestions out
    there.
    
    
  • [Eug-lug] Subject: Copying, moving, whatever… using wildcards in destination : wc2fn.py



    horstMon Nov 1 23:40:36 PST 2004

    > Date: Mon, 1 Nov 2004 17:43:27 -0800
    > From: Hal Pomeranz <hal at deer-run.com>
    > To: Eugene Unix and Gnu/Linux User Group <euglug at euglug.org>
    > Subject: Re: [Eug-lug] Subject: Copying, moving,
    >     whatever... using wildcards in destination : wc2fn.py
    > 
    >>  Actually there is a perl 'rename' program in many packages --I suggest to
    >> read the documentation of it and decide for yourself how 'friendly'
    >> it'susage seems to you :-) // i.e. I do read documentations
    >
    > I've been using the Perl rename program that Horst is alluding to for
    > some time now and it does most things I need it to do.  One feature
    > that I did add in my own version of the script (attached below) is
    > a "-n" switch to have the script tell me what it would do with my
    > arguments, but not actually do the renaming.  This allows me to test
    > my syntax before actually changing any file names.
      ...
    
    This is great -- we are finally talking and exchanging code !
    Hal, thanks for sharing your front-end to rename.
    
    Sorry, but I would consider you as one of the 'distinguished veterans of 
    regular expressions' as referred to in my original message (hey, accept it 
    or not  --  it's  not a bad sticker :-)
    
      Now how would you transfer the perl's 'rename' to a perl's 'copy' (using 
    destination replacement), or to a perl's anyThing source-to-destination ?
      My point was to have such a tool in place as a shell utility; with hooks 
    to (or wraps to) 'cp' 'mv' 'orWhatever'. This can be done in python, perl, 
    *sh, or C.
      I may have made a mistake (=offending people), by pushing python as a 
    language to implement such a tool... Hey, if your favorite language has  a 
    better/different implementation, let us know !
    
      - Horst
    
    
    
  • [Eug-lug] Subject: Copying, moving, whatever… using wildcards in destination : wc2fn.py



    Allen BrownMon Nov 1 20:58:34 PST 2004

    This looks like a cool program.  I haven't tried it yet.  But I
    like the idea of being able to quickly change upper to lower
    case.  And I admit that even tho I can do similar tasks in bash,
    it would be nice to have a canned program since I tend to do it
    fairly often.
    
    For instance a one liner to change upper case to lower case in bash:
    for upper in *; do lower=$(echo $upper | tr '[A-Z]' '[a-z]'); mv $upper $lower; done
    --
    Allen Brown
      work: Agilent Technologies      non-work: http://www.peak.org/~abrown/
            allen_brown at agilent.com             abrown at peak.org
      Experience is the name everyone gives to their mistakes. ---Oscar Wilde
    
    
    
  • [Eug-lug] Configuring KDE



    Allen BrownMon Nov 1 20:47:51 PST 2004

    That didn't do it.  But thank you for the suggestion.  It was
    worth a try.
    --
    Allen Brown
      work: Agilent Technologies      non-work: http://www.peak.org/~abrown/
            allen_brown at agilent.com             abrown at peak.org
      If all economists were laid end to end,
      they would not reach a conclusion. ---George Bernard Shaw
    
    
    On Mon, 1 Nov 2004, Steve wrote:
    
    > On Sun, 2004-10-31 at 18:53, Allen Brown wrote:
    > > Excellent!  Actually, clicking on my desktop doesn't produce a menu.
    > > I haven't found where that is enabled.  But I worked thru the
    > > menus from the lower panel and found it.
    > > 
    > > And I've replaced konsole with gnome-terminal.  If you are familiar
    > > with gnome-terminal, it launches a web browser if you C-A-left over
    > > a highlighted URL.  I don't think the selection of browser is in
    > > gnome-terminal.  Best I can tell, it is some external setting.
    > > Currently it is launching konquerer.  I want it to use mozilla.
    > > Any idea how I control that?
    > 
    > You can try the kcontrol app and change File Associations (in the
    > Components section).
    > 
    > _______________________________________________
    > EUGLUG mailing list
    > euglug at euglug.org
    > http://www.euglug.org/mailman/listinfo/euglug
    > 
    
  • [Eug-lug] Configuring KDE



    SteveMon Nov 1 19:19:59 PST 2004

    On Sun, 2004-10-31 at 18:53, Allen Brown wrote:
    > Excellent!  Actually, clicking on my desktop doesn't produce a menu.
    > I haven't found where that is enabled.  But I worked thru the
    > menus from the lower panel and found it.
    > 
    > And I've replaced konsole with gnome-terminal.  If you are familiar
    > with gnome-terminal, it launches a web browser if you C-A-left over
    > a highlighted URL.  I don't think the selection of browser is in
    > gnome-terminal.  Best I can tell, it is some external setting.
    > Currently it is launching konquerer.  I want it to use mozilla.
    > Any idea how I control that?
    
    You can try the kcontrol app and change File Associations (in the
    Components section).
    
    
  • [Eug-lug] Needed: Speakers for future meetings of the Portland Linux/Unix Group (PLUG)



    David MandelMon Nov 1 19:15:53 PST 2004

    I have been having trouble finding speakers for the PLUG meetings for
    several months now, and I believe Alan <alan at clueserver.org> has also
    been having trouble getting speakers for the Advanced Topics Meetings.
    
    I have a few leads, but I could sure use some more.
    If anyone has a talk or knows of anyone who could give an interesting
    talk, please let us know.
    
                                              Sincerely,
                                              David Mandel
                                              Chief Activist
                                              Portland Linux/Unix Group
                                              560 SE Alexander
                                              Corvallis, Oregon 97333
                                              (541) 684-4644 at work
                                              (541) 730-5285 cell
    
       ======================================================================
       David Mandel, Instructor            http://www.PioneerPacific.edu
                              Other Affiliations
       David Mandel                        http://www.DavidMandel.com
       Portland Linux/Unix Group           http://pdxLinux.org 
       LinuxFund                           http://LinuxFund.org
       ======================================================================
    
  • [Eug-lug] ANNOUNCEMENT: November PLUG Meeting



    David MandelMon Nov 1 18:46:38 PST 2004

                             MEETING ANNOUNCEMENT
    
                        The Portland Linux/Unix Group
                                  will meet
                        7 PM Thursday Nov 4, 2004
                                      at
                          Portland State University
                                    in the
                            Smith Memorial Center
                                   Room 298
                           On the block bounded by
       SW Montgomery, SW Broadway (7th), SW Harrison, and SW Park (9th)
    
          **********************************************************
              
                                     PRESENTATION
    
                                     A Discussion
                                    of the role of
                                 Open Source Software
                                          in
                                   Career Education
    
                                          by
    
                                     David Mandel
                                <dmandel at pdxLinux.org>
    
    
          This is not a technical presentation, because David hasn't
          had time to do much new technical work lately.  Instead he
          has been busy teaching Information Technology at Pioneer 
          Pacific College.
          So, David will discuss a few things he has learned in this 
          position.
    
          **********************************************************
    
              Agenda:
              
                  7:00 - 7:30  Business
                       We will discuss the status of our ongoing projects 
                       including PLUG's monthly Advanced Topics meetings, 
                       PLUG's monthly hands on clinics, PLUG for Education,
                       etc.
                       Microsharp is no longer hosting pdxLinux.org.
                       This task has gone to our good friends at 
                       www.NakedApe.com.  We will discuss the going 
                       conversion to their server(s).
                       David Mandel will also give the group an update
                       on room reservations for 2005.
                       We will also discuss ways of finding speakers for
                       future meetings.
    
                  7:30 - 8:30  Presentation
              
                       See above
              
                  9:00 - ...  Beer
                                      The Lucky Labrador Brewing Company
                                      915 SE Hawthorne
              
              
              
                                              David Mandel
                                              Chief Activist
                                              Portland Linux/Unix Group
                                              560 SE Alexander
                                              Corvallis, Oregon 97333
                                              (541) 684-4644 at work
                                              (541) 730-5285 mobile
                                              dmandel at pdxLinux.org
              
              
              P.S.  Biznix which specializes in Linux and UNIX support for 
                    the Business Computer User meets on the second 
                    Thursday of the month at the Novell offices in Tigard.
                    See http://www.Bizix.org for details.
                    
              P.S.  PDXLUG provides a less formal alternative to PLUG 
                    emphasizing the needs of new users.   PDXLUG meets 
                    every second Thursday of the month in southeast Portland.
                    See http://www.PDXLUG.org for details.
    
              P.S.  The Mid Willamette Valley Linux Users Group meets at
                    Oregon State University (generally Owen Hall room 101)
                    on the first Tuesday of the month.
                    See http://www.mwvlug.org/ for details.
              
              P.S.  The Eugene Linux Users Group meets several times a month.
                    See http://www.euglug.org for details.
    
       ======================================================================
       David Mandel, Instructor            http://www.PioneerPacific.edu
                              Other Affiliations
       David Mandel                        http://www.DavidMandel.com
       Portland Linux/Unix Group           http://pdxLinux.org
       LinuxFund                           http://LinuxFund.org
       ======================================================================
    
    
    
    
    
    
    
  • [Eug-lug] Subject: Copying, moving, whatever… using wildcards in destination : wc2fn.py



    Hal PomeranzMon Nov 1 17:43:27 PST 2004

    >  Actually there is a perl 'rename' program in many packages --I suggest to 
    > read the documentation of it and decide for yourself how 'friendly' 
    > it'susage seems to you :-) // i.e. I do read documentations
    
    I've been using the Perl rename program that Horst is alluding to for
    some time now and it does most things I need it to do.  One feature
    that I did add in my own version of the script (attached below) is
    a "-n" switch to have the script tell me what it would do with my
    arguments, but not actually do the renaming.  This allows me to test
    my syntax before actually changing any file names.
    
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    Hal Pomeranz, Founder/CEO      Deer Run Associates      hal at deer-run.com
        Network Connectivity and Security, Systems Management, Training
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    
    #!/usr/bin/perl
    
    $testmode = 0;
    if ($ARGV[0] eq '-n') {
    	shift(@ARGV);
    	$testmode = 1;
    }
    
    ($op = shift @ARGV) || die 'Usage: $0 [-n] expr [file ...]\n';
    if (!@ARGV) {
    	@ARGV = <STDIN>;
    	chop(@ARGV);
    }
    for (@ARGV) {
    	$was = $_;
    	eval $op;
    	die $@ if $@;
    	if ($testmode) { print "rename($was, $_)\n"; }
    	else           { rename($was, $_) unless ($was eq $_); }
    }
    
  • [Eug-lug] Subject: Copying, moving, whatever… using wildcards in destination : wc2fn.py



    jgw at absent.orgMon Nov 1 17:37:19 PST 2004

    >   Actually there is a perl 'rename' program in many packages --I suggest
    > to
    > read the documentation of it and decide for yourself how 'friendly'
    > it'susage seems to you :-) // i.e. I do read documentations
    
    I don't know of the perl rename program. I usually perform all of my file
    system tasks with sh or bash, and sometimes even a tcsh script.
    
    > My point was not to have different shell scripts for *each* little task.
    >   I wanted a tool specifically to handle filename expansion, using the
    > intuitive glob style (yes, a shell feature too :-) for the destination
    > file, similar to how I match the source files. Calling it an extension of
    > glob may be far fetched, but it goes in that direction.
    >   By putting this all in one tool it's a snap to run commands as a test
    > first, or in the debug mode, and to provide meaningful help messages upon
    > failure, add some documentation,...
    
    I didn't say you needed different shell scripts, I said that you can write
    *A* script (singular) to do what you said can't be done with shell
    scripting.
    
    >   *** I like to challenge you to pick about half of the examples I gave
    > (some easy/some complex) and show us the *one* shell script that does it.
    
    Perhaps when I get some time. Unfortunately, I only have enough time to
    preach the UNIX gospel this week, not any time to actually document my
    point. Perhaps someone else experienced with the shell might speak up?
    
    cheers