Hello there!
Is there a nice and simple awk/sed trick to just capitalise a word? I didn't
come up with one so far. I could do it by hand, it's a known set of words, but
it would be nicer with a real word-independent mechanism.
Kindest regards
Julien
Music was my first lo
On Fri, 26 Sep 2008 12:11:52 +0200 (CEST) Julien Claassen <[EMAIL PROTECTED]>
wrote:
> Hello there!
>Is there a nice and simple awk/sed trick to just capitalise a word? I
> didn't
> come up with one so far. I could do it by hand, it's a known set of words,
> but
> it would be nicer with a
Hi Julien,
People usually use tr for that:
$ echo foo | tr 'a-z' 'A-Z'
FOO
- Steve
On 26 Sep 2008, at 11:11, Julien Claassen wrote:
> Hello there!
> Is there a nice and simple awk/sed trick to just capitalise a
> word? I didn't
> come up with one so far. I could do it by hand, it's a known
On Fri, 2008-09-26 at 11:47 +0100, Steve Harris wrote:
> Hi Julien,
>
> People usually use tr for that:
>
> $ echo foo | tr 'a-z' 'A-Z'
> FOO
i believe he meant capitalize as in "foo" -> "Foo" which is an order of
magnitude harder. i don't believe that sed can do it. perl probably can.
__
On Fri, Sep 26, 2008 at 11:53 AM, Paul Davis <[EMAIL PROTECTED]> wrote:
> i believe he meant capitalize as in "foo" -> "Foo" which is an order of
> magnitude harder. i don't believe that sed can do it. perl probably can.
It can, e.g.
$ echo hello | perl -pe 's/(.*)/\u$1\e/'
Chris
__
On Fri, Sep 26, 2008 at 11:56 AM, Chris Cannam
<[EMAIL PROTECTED]> wrote:
> $ echo hello | perl -pe 's/(.*)/\u$1\e/'
I was forgetting there's also a function for this, you don't have to
use the rather opaque substitution syntax:
$ echo hello | perl -e 'print ucfirst <>'
Chris
__
Hi!
Thank you all! I managed. there is something I didn't think of, which is,
that you can output only part of shell-variables. Now it looks like this:
VAR="Monday"
tmp_first=`echo "${VAR:0:1}" | tr 'a-z' 'A-Z'`
tmp_rest=`echo "${VAR:1}"
tmp_rest_short=`echo "${VAR:1:2}"`
var_long="$tmp_first$t
Julien Claassen:
> Hi!
>Thank you all! I managed. there is something I didn't think of,
> which is, that you can output only part of shell-variables. Now it
> looks like this: VAR="Monday"
> tmp_first=`echo "${VAR:0:1}" | tr 'a-z' 'A-Z'`
> tmp_rest=`echo "${VAR:1}"
> tmp_rest_short=`echo "${VAR
On Sat, 2008-09-27 at 00:03 +0200, Wolfgang Woehl wrote:
> Oh my god :)
> This one is ugly too but, while we're at it, what the hell:
> echo "monday" | cut -b -3 | sed 's/\(^.\)/\U\1/'
While you are at it, could you explain that last sentence once more for
those in the audience that did not get it
Jens M Andreasen:
> On Sat, 2008-09-27 at 00:03 +0200, Wolfgang Woehl wrote:
> > Oh my god :)
> > This one is ugly too but, while we're at it, what the hell:
> > echo "monday" | cut -b -3 | sed 's/\(^.\)/\U\1/'
>
> While you are at it, could you explain that last sentence once more
> for those in t
Thankyou!
> sed 's/\(^.\)/\U\1/'
> >
> ^. is the 1st char, put into () (protected with \) to store in \1
> which gets uppercased with \U.
You never mentioned the forward slash in our tent camp. Is i it so that
everybody else - that is important, knows the meaning of s/junk/gold ?
_
2008/9/27 Wolfgang Woehl <[EMAIL PROTECTED]>:
> Oh my god :)
> This one is ugly too but, while we're at it, what the hell:
> echo "monday" | cut -b -3 | sed 's/\(^.\)/\U\1/'
>
python -c "d='monday'.capitalize(); print d[0:3]"
! :-)
___
Linux-audi
The '/' is a vi(m) thing. If you belong to the wrong editor-religion i.e.
emacs, you might not know. Me not being one of the emacsuns I don't know if
you have it. :-)
Music was my first love and it will be my last (John Miles)
FIND MY WEB-PROJECT AT:
http://ltsb.sourc
Emanuel Rumpf:
> python -c "d='monday'.capitalize(); print d[0:3]"
Instan methods, whoa. You win :) Can you get rid of d?
Wolfgang
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-a
Jens M Andreasen:
> You never mentioned the forward slash in our tent camp. Is i it so
> that everybody else - that is important, knows the meaning of
> s/junk/gold ?
Well, Bill Gates comes to mind. But then that's not entirely fair or
true, is it?
Be good, Wolfgang
2008/9/27 Wolfgang Woehl <[EMAIL PROTECTED]>:
> 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; p
Emanuel Rumpf:
> python -c "print 'monday'[:3].capitalize()"
Slick. I knew sed wouldn't stand a chance \)
Wolfgang
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
On Sat, 2008-09-27 at 01:11 +0200, Julien Claassen wrote:
> The '/' is a vi(m) thing. If you belong to the wrong editor-religion i.e.
> emacs, you might not know. Me not being one of the emacsuns I don't know if
> you have it. :-)
I use the dreaded editor emacs everyday, thankyou - but more impo
Hi!
I also use C and c++, but not for this problem, Too many external packages
involved anyway.
Announcement is coming up. :-)
Kindest regards
Julien
Music was my first love and it will be my last (John Miles)
FIND MY WEB-PROJECT AT:
http://ltsb.sour
Scripting is for pansies, real hAxXoRs and with 0xDF.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Oh scripting is a very potent and powerful thing, if you know where to go and
what to do. :-)
Truly: Everything in its place.
Kindest regards
Julien
Music was my first love and it will be my last (John Miles)
FIND MY WEB-PROJECT AT:
http://ltsb.sourcefo
Gone is the dream of UNIX. Long it live.
> Solutions of simple problems, demanding several complex packages to be
> piped into one each other, does not take my fancy.
>
> ___
> Linux-audio-dev mailing list
> Linux-audio-dev@lists.linuxaudio.org
> http:
On Sat, 2008-09-27 at 00:44 +0100, victor wrote:
> Gone is the dream of UNIX. Long it live.
>
I dunno what your dream is? ... But my nightmare is the day when
procesors gets so powerful so that the new kids on the block decides to
rewrite the (Linux)kernel in javascript!
>
> > Solutions of simp
Well, that dream was not mine but Dennis Ritchie's and
Ken Thompson's...
- Original Message -
From: "Jens M Andreasen" <[EMAIL PROTECTED]>
To: "victor" <[EMAIL PROTECTED]>
Cc:
Sent: Saturday, September 27, 2008 1:31 AM
Subject: Re: [LAD] [ot] c
2008/9/27 Jens M Andreasen <[EMAIL PROTECTED]>:
> ... But my nightmare is the day when
> procesors gets so powerful so that the new kids on the block decides to
> rewrite the (Linux)kernel in javascript!
>
Still in planning stage, but maybe not that far away:
http://sourceforge.net/projects/cleese
On Sat, 2008-09-27 at 12:04 +0200, Emanuel Rumpf wrote:
> Still in planning stage, but maybe not that far away:
> http://sourceforge.net/projects/cleese/
>
>
> >> > Solutions of simple problems, demanding several complex packages to be
> >> > piped into one each other, does not take my fancy.
> >
26 matches
Mail list logo