첫문자를 대문자로

lkjt의 이미지
3610
points
3
points

쉘로 always there for you를 Always There For You로 바꾸려면 어떻게 해야 하나요?

토끼아빠의 이미지
4517
points

$str = "always there for

3
points

$str = "always there for you";
$str = ucwords($str);
echo $str;

결과
Always There For You

좋은 하루 되세요!!

lkjt의 이미지
3610
points

답변

1
point

답변 감사드립니다..

하지만 쉘로 할 수 있는 방법은 없을까요?

lifthrasiir의 이미지
7163
points

echo always there for you |

2
points

echo always there for you | awk 'BEGIN{RS=" "} {printf toupper(substr($1,1,1)) substr($1,2) " "}'

정도면 될까요? 사실 굳이 셸을 쓸 이유는 없습니다만.

cinsk의 이미지
11950
points

$ echo "always there for

3
points

$ 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/

pung96의 이미지
3173
points

perl

2
points

echo always there for you | perl -pe's/(\w+)/ucfirst$1/eg'


echo always there for you | perl -pe's/(\w+)/\u$1/g'

lkjt의 이미지
3610
points

와~ 답변

1
point

와~ 답변 감사드립니다~!

댓글 보기 옵션

원하시는 댓글 전시 방법을 선택한 다음 "설정 저장"을 누르셔서 적용하십시오.