Tag Info

New answers tagged


\U is a GNUism, actually inspired from a BSDism since that comes from the equivalent s command in the ex editor (command-line mode of vi). OS/X sed most likely descends from FreeBSDs itself descending from 4.4BSD's sed, which was rewritten from scratch following copyright issues with AT&T. In any case, neither BSD nor AT&T sed support \U in their s ...


sed 'h;s/[^,]*,[^,]*,// y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/ H;x;s/[^,]*\n// ' foo.file


The simple task do not require sed while IFS=',' read -r first mid last do echo "$first, $mid, ${last^^}" done < file_with_commas If bash version do not support variable expansion you can use tr last=$(echo $last | tr [[:lower:]] [[:upper:]])


Seems /U and /L just do not work with OSX/BSD sed along with sed /pattern/,+2d # like `sed '/pattern/{N;N;d;}'` sed -n 0~3p # like `awk NR%3==0` sed /pattern/Q # like `awk '/pattern/{exit}1'` or `sed -n '/pattern/,$!p'` sed 's/\b./\u&/g' # \u converts the next character to uppercase sed 's/^./\l&/' # \l converts the next character to lowercase sed ...


Replace --color with -G when running ls.

Top 50 recent answers are included