ocehb: (Default)
[personal profile] ocehb


# for i in /usr/local/bin/test.ext /usr/local/bin/test test.ext test; do \
    perl -le 'printf "Src:  %s\n\tPath: %s\n\tFile: %s\n\tName: %s\n\tExt:  %s\n",$ARGV[0],($ARGV[0]=~ m#^(.+/|)(([^.]+).?(.+?|))$#)' $i; \
  done 
Src:  /usr/local/bin/test.ext
        Path: /usr/local/bin/
        File: test.ext
        Name: test
        Ext:  ext
Src:  /usr/local/bin/test
        Path: /usr/local/bin/
        File: test
        Name: test
        Ext:  
Src:  test.ext
        Path: 
        File: test.ext
        Name: test
        Ext:  ext
Src:  test
        Path: 
        File: test
        Name: test
        Ext:  

Date: 2007-06-29 09:43 am (UTC)
From: [identity profile] gone-one.livejournal.com
А почему не так? ;)
perl -e 'printf"Src:  %s\n\tPath: %s\n\tFile: %s\n\tName: %s\n\tExt:  %s\n",$_,m#^(.+/|)(([^.]+).?(.+?|))$#for@ARGV' \
    /usr/local/bin/test.ext /usr/local/bin/test test.ext test

Date: 2007-07-13 06:10 pm (UTC)
From: [identity profile] deepone.livejournal.com
http://directory.fsf.org/devel/prog/perl/zoidberg.html

Profile

ocehb: (Default)
ocehb

January 2021

S M T W T F S
     12
345 6789
10111213141516
17181920212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 6th, 2026 11:10 am
Powered by Dreamwidth Studios