[LAD] [ot] capitalising words in a shell-script

Emanuel Rumpf xbran at web.de
Fri Sep 26 23:26:57 UTC 2008


2008/9/27 Wolfgang Woehl <tito at rumford.de>:
> Emanuel Rumpf:
>
>> python -c "d='monday'.capitalize(); print d[0:3]"
>
> Instan methods, whoa. You win :) Can you get rid of d?
>

like this: ?

python -c "print 'monday'[:3].capitalize()"


with use of stdin:
echo "monday" | python -c "import sys; print sys.stdin.read().capitalize()[:3]"



More information about the Linux-audio-dev mailing list