Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ${i:r}-question



On Aug 28,  2:55am, Meino Christian Cramer wrote:
} Subject: Re: ${i:r}-question
}
}  The code fragment
} 
} 	 ${${(M)afile%%(.tar|).(7z|bz2|gz)}#.}	
} 
}  would fail on files, which are of the pattern
} 
} 	 zsh-4.2.5-doc.bz2  (only one extension) 

What makes you think so?

schaefer[501] afile=zsh-4.2.5-doc.bz2
schaefer[502] print ${${(M)afile%%(.tar|).(7z|bz2|gz)}#.}
bz2
schaefer[503] afile=zsh-4.2.5-doc.tar.gz
schaefer[504] print ${${(M)afile%%(.tar|).(7z|bz2|gz)}#.}
tar.gz

Note that (.tar|) has an empty sub-pattern to the right of the vertical
bar, so it means ".tar or nothing".

}  or? (and all files, which are no Makefiles.... ;O)

I'm afraid I don't understand what you mean about files that are not
Makefiles.



Messages sorted by: Reverse Date, Date, Thread, Author