Berkeley CSUA MOTD:Entry 14423
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2024/11/23 [General] UID:1000 Activity:popular
11/23   

1998/8/3 [Computer/SW/Unix] UID:14423 Activity:nil
8/3     Is there a way via sed to capitalize everything within, say,
        brackets?
        \_ fuck sed, use perl.
           \_ Ok then, how in perl?
        \_ I don't know how to do this in sed, but the following tcl
           script should do what you want:
######################################################################
#!/usr/local/bin/tclsh
regsub -all {(\[)([^]]+)(\])} [read stdin] {\[[string toupper "\2"]\]} match
puts [subst $match]
######################################################################
          --emin