Print the number of lowercase letters at the (Web design company)

Print the number of lowercase letters at the beginning of p: expr $p : ‘[a-z]*’ Result is 7 Match the lowercase letters at the beginning of p: expr $p : ‘([a-z]*)’ Result is “version” Truncate $x if it contains five or more characters; if not, just print $x. (Logical OR uses the second argument when the first one is 0 or null; i.e., when the match fails.) expr $x : ‘(…..)’ | $x In a shell script, rename files to their first five letters: mv $x expr $x : ‘(…..)’ | $x (To avoid overwriting files with similar names, use mv -i.) Return to: Alphabetical Directory of Linux Commands Copyright 2000-2002 O’Reilly & Associates, Inc. All Rights Reserved. All trademarks and registered trademarks appearing on the O’Reilly Network are the property of their respective owners. For problems or assistance with this site, email help@oreillynet.com

Leave a Reply