MESSAGE
DATE | 2016-04-25 |
FROM | Ruben Safir
|
SUBJECT | Subject: [Hangout-NYLXS] + behavior in the shell
|
I have a file system that looks like this
[ruben-at-manjaro 100CANON]$ ls -l total 994144 -rwxr-xr-x 1 root root 4679900 Mar 24 12:59 IMG_6975.JPG -rwxr-xr-x 1 root root 3801612 Mar 24 12:59 IMG_6976.JPG -rwxr-xr-x 1 root root 4740441 Mar 24 12:59 IMG_6977.JPG -rwxr-xr-x 1 root root 4255330 Mar 24 15:34 IMG_6978.JPG -rwxr-xr-x 1 root root 4233463 Mar 24 15:35 IMG_6979.JPG -rwxr-xr-x 1 root root 4775372 Mar 24 15:35 IMG_6980.JPG -rwxr-xr-x 1 root root 4738153 Mar 24 15:35 IMG_6981.JPG -rwxr-xr-x 1 root root 5051497 Mar 24 15:35 IMG_6982.JPG -rwxr-xr-x 1 root root 5149383 Mar 24 15:36 IMG_6983.JPG -rwxr-xr-x 1 root root 5573219 Mar 24 16:11 IMG_6984.JPG -rwxr-xr-x 1 root root 4669847 Mar 24 16:12 IMG_6985.JPG -rwxr-xr-x 1 root root 5345875 Mar 24 16:13 IMG_6986.JPG -rwxr-xr-x 1 root root 5473841 Mar 24 16:14 IMG_6987.JPG -rwxr-xr-x 1 root root 5191371 Mar 24 16:14 IMG_6988.JPG -rwxr-xr-x 1 root root 5143869 Mar 24 16:15 IMG_6989.JPG -rwxr-xr-x 1 root root 4929913 Mar 24 16:15 IMG_6990.JPG
etc
why does this + not work as i expect
[ruben-at-manjaro 100CANON]$ for i in `ls -l |grep 'Apr 25'| sed 's/\([0-9]+\.JPG\)//' `; do echo $i; done; -rwxr-xr-x 1 root root 4425616 Apr 25 10:38 IMG_7152.JPG -rwxr-xr-x 1 root root 3290617 Apr 25 10:38 IMG_7153.JPG -rwxr-xr-x 1 root root 3545963 Apr 25 10:38 IMG_7154.JPG -rwxr-xr-x 1 root root 3474604 Apr 25 10:39 IMG_7156.JPG -rwxr-xr-x 1 root root 3991317 Apr 25 10:39 IMG_7157.JPG -rwxr-xr-x 1 root root 3359499 Apr 25 10:39 IMG_7158.JPG -rwxr-xr-x 1 root root 4356599 Apr 25 10:40 IMG_7159.JPG -rwxr-xr-x 1 root root 3062197 Apr 25 Apr 25 10:40 IMG_7159.JPG -rwxr-xr-x 1 root root 3062197 Apr 25 10:40 IMG_7160.JPG -rwxr-xr-x 1 root root 3521654 Apr 25 10:40 IMG_7161.JPG -rwxr-xr-x 1 root root 4573821 Apr 25 10:41 IMG_7162.JPG -rwxr-xr-x 1 root root 4370011 Apr 25 10:41 IMG_7163.JPG
etc
and
[ruben-at-manjaro 100CANON]$ for i in `ls -l |grep 'Apr 25'| sed 's/\([0-9]*\.JPG\)//' `; do echo $i; done; -rwxr-xr-x 1 root root 4425616 Apr 25 10:38 IMG_ -rwxr-xr-x 1 root root 3290617 Apr 25 10:38 IMG_ -rwxr-xr-x 1 root root 3545963 Apr 25 10:38 IMG_ -rwxr-xr-x 1 root root 3476478 Apr 25 10:38 IMG_ -rwxr-xr-x 1
etc
which is that I expect the + to do. + is supposed to match one or more of the atom before
Even .+ is not doing what I thoguht
[ruben-at-manjaro 100CANON]$ for i in `ls -l |grep 'Apr 25'| sed 's/\([0-9].+\.JPG\)//' `; do echo $i; done; -rwxr-xr-x 1 root root 4425616 Apr 25 10:38 IMG_7152.JPG -rwxr-xr-x 1 root root 3290617 Apr 25 10:38 IMG_7153.JPG -rwxr-xr-x 1 root root 3545963 Apr 25 10:38 IMG_7154.JPG
-- So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological proportions in the mind of the world - RI Safir 1998 http://www.mrbrklyn.com
DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 http://www.nylxs.com - Leadership Development in Free Software http://www2.mrbrklyn.com/resources - Unpublished Archive http://www.coinhangout.com - coins! http://www.brooklyn-living.com
Being so tracked is for FARM ANIMALS and and extermination camps, but incompatible with living as a free human being. -RI Safir 2013 _______________________________________________ hangout mailing list hangout-at-nylxs.com http://www.nylxs.com/
|
|