두 개의 정렬 된 텍스트 파일이 있습니다. A의 데이터 파일은 다음과 같습니다Bash - 하나의 문자열을 다른 파일의 다른 문자열로 바꿉니다.
adam
humanities
antwon
sciences
bernard
economics
castiel
sciences
dmitri
informatics
zoe
mathematics
파일 B의 데이터는 다음과 같습니다
adamburnston
antwonreed
justbernard
castiel
dmitrivalchenkov
zoematthews
내가 파일 B의 라인 (adamburnston)로, 파일 A (아담)의 라인을 교체해야 . 두 파일 모두 사전 순으로 정렬되며 동일한 수의 항목을 포함합니다. 이 결과는 어떻게 얻을 수 있습니까?
예상 출력 :
adamburnston
humanities
antwonreed
sciences
justbernard
economics
castiel
sciences
dmitrivalchenkov
informatics
zoematthews
mathematics
당신은 무엇을하려고 했습니까? – devnull
귀하의 프로필에 :'Python at the moment'을 배우십시오. 왜 활용하지 않겠습니까? – devnull
@devnull - 'coz bash에서 명시 적으로 요청했습니다. 선택의 여지가 있다면, 파이썬으로 시도해 볼 것입니다. – rahuL