File: capitalize.m4

package info (click to toggle)
m4 1.4-10
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,592 kB
  • ctags: 1,114
  • sloc: ansic: 10,411; makefile: 395; sh: 330; lisp: 243
file content (8 lines) | stat: -rw-r--r-- 332 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
dnl
dnl convert to upper- resp. lowercase
define(`upcase', `translit(`$*', `a-z', `A-Z')')
define(`downcase', `translit(`$*', `A-Z', `a-z')')
dnl
dnl capitalize a single word
define(`capitalize1', `regexp(`$1', `^\(\w\)\(\w*\)', `upcase(`\1')`'downcase(`\2')')')
define(`capitalize', `patsubst(`$1', `\w+', ``'capitalize1(`\0')')')