쉘로 always there for you를 Always There For You로 바꾸려면 어떻게 해야 하나요?
$str = "always there for you"; $str = ucwords($str); echo $str;
Always There For You
좋은 하루 되세요!!
답변 감사드립니다..
하지만 쉘로 할 수 있는 방법은 없을까요?
echo always there for you | awk 'BEGIN{RS=" "} {printf toupper(substr($1,1,1)) substr($1,2) " "}'
정도면 될까요? 사실 굳이 셸을 쓸 이유는 없습니다만.
$ echo "always there for you" | sed 's/\<\([a-z]\)/\U\1/g' Always There For You $ _
-- C FAQ: http://www.eskimo.com/~scs/C-faq/top.html Korean Ver: http://www.cinsk.org/cfaqs/
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html Korean Ver: http://cinsk.github.io/cfaqs/
echo always there for you | perl -pe's/(\w+)/ucfirst$1/eg'
나
echo always there for you | perl -pe's/(\w+)/\u$1/g'
와~ 답변 감사드립니다~!
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
$str = "always there for
결과
Always There For You
좋은 하루 되세요!!
좋은 하루 되세요!!
답변
답변 감사드립니다..
하지만 쉘로 할 수 있는 방법은 없을까요?
echo always there for you |
정도면 될까요? 사실 굳이 셸을 쓸 이유는 없습니다만.
$ echo "always there for
--
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Korean Ver: http://www.cinsk.org/cfaqs/
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Korean Ver: http://cinsk.github.io/cfaqs/
perl
나
와~ 답변
와~ 답변 감사드립니다~!
댓글 달기