2012-01-04 4 views
1

나는 csh 스크립트를 가지고 있으며, 내가 무엇을해도 올바른 탭 공간을 되풀이하지 않습니다.
이 내가 원하는 것입니다 :csh 스크립트로 구분 된 탭을 에코하는 방법

header 1 header 2 header 3 header 4 

사례 1 :

echo header 1 header 2 header 3 header 4 | tabify 

출력 : 그것은 탭

사례 2 모든 공백을 대체합니다 :

echo "header 1\\theader 2\\theader 3\\theader 4" 

또는

,210
echo header 1\\theader 2\\theader 3\\theader 4 

출력 : \\ theader 헤더 1 2 3 \\ \\ theader theader 4

사례 3 :

echo -e "header 1\\theader 2\\theader 3\\theader 4" 

출력 : 1 -e 헤더 \\ theader 2 \\ theader 3 \ \ theader 4

도움 말? T.T

답변

4

CShell은 빠지지만 printf는 다시 한 번 저장합니다.

$ printf 'header 1\theader 2\theader 3\n' 
header 1 header 2 header 3 

+0

우트을 (탭을 보여 스택 오버플로의 무능력을 무시하십시오)! 그것은 내 하루를 절약했다 – BPm

+0

오, 왜 당신은 에코가 작동하지 않는지 아십니까? – BPm

+0

나는 tcsh가 나쁜 껍질이고 나쁜 에코의 내장 된 구현을 가지고 있기 때문에 "와야 만 할 것입니다. – cha0site

관련 문제