쉘스크립트

sed와 gawk의소개

트리스탄1234 2022. 7. 6. 13:18
728x90
반응형

 

1. 텍스트 조작하기

로그 파일이나 리눅스에서 많이 데이터들이 텍스트 형식으로 저장이 됩니다. 이들 텍스트에서 필요한 정보만 추출하고 가공해서 사용하기 유용하게 만들어 주는 텍스트 에디터 중에 sed와 gawk가 있습니다.

sed Editor

sed 에디터는 stream editor로 불립니다. 일반적은 상호 동작 텍스트 에디터는 데이터를 삽입, 삭제 또는 교체를 할때에는 키보드로 명령을 입력 하고 처리 하는 방식 이지만 stream editor는 적용한 룰에 따라 데이터 스트림을 편집 합니다. sed 에디터의 사용 구문은 아래와 같습니다.

$sed option script file

아래표는 sed에서 사용할 수 있는 option들 입니다.

sed 명령을 사용하는 하나의 예제를 보겠 습니다.

$ echo "This is a test" | sed ’s/test/big test/’

This is a big test

$

echo로 출력되는 결과를 파이프를 이용해서 sed에 전달하고 s 명령을 사용해 test를 big data로 바꾸어 출력을 시키는 예문 입니다.

$ cat data1 ==> data 1파일을 살펴 봅니다.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
$ sed ’s/dog/cat/’ data1 ==> data 1파일에 있는 dog를 cat로 변환 시킵니다.
The quick brown fox jumps over the lazy cat.
The quick brown fox jumps over the lazy cat.
The quick brown fox jumps over the lazy cat.
The quick brown fox jumps over the lazy cat.
$

명령어 라인에서 여러개의 데이터 명령어 사용하기

한개의 명령어 라인에 여러개의 sed 명령을 사용하기 위해서는 -e옵션과 명령어 사이에 세미콜론으로 구분을 해줘야 합니다.

아래는 사용 예제 입니다.

$ sed -e ’s/brown/green/; s/dog/cat/’ data1 ==> data 1파일에 있는 brown을 green으로 cat을 dog로
The quick green fox jumps over the lazy cat
The quick green fox jumps over the lazy cat
The quick green fox jumps over the lazy cat
The quick green fox jumps over the lazy cat
$
세미콜론 대신에 두번째 프롬프트를 이용하는 방법도 있습니다.
$ sed -e ’ 따옴표로 명령들을 묶어 줍니다.
> s/brown/green/
> s/fox/elephant/
> s/dog/cat/’ data1
The quick green elephant jumps over the lazy cat
The quick green elephant jumps over the lazy cat
The quick green elephant jumps over the lazy cat
The quick green elephant jumps over the lazy cat
$

파일에서 에디터 명령어 읽어 오기

실행할 명령어가 많은 경우 해당 명령들을 파일로 저장해서 불러 오는 방법도 있습니다. 아래는 예제 입니다.

$ cat script1
s/brown/green/
s/fox/elephant/
s/dog/cat/
$
$ sed -f script1 data1 ==> script1파일의 명령을 불러 들여 data1파일의 데이터를 처리 합니다.
The quick green elephant jumps over the lazy cat.
The quick green elephant jumps over the lazy cat.
The quick green elephant jumps over the lazy cat.
The quick green elephant jumps over the lazy cat.
$

gawk 프로그램

gwak는 sed보다 좀 더 강화된 에디터라고 생각 하시면 될것 같습니다. sed에서는 명령어를 사용해서 data를 처리 하는 정도 였지만 gwak에서는 프로그램을 사용해서 데이터를 처리 하고 변수를 사용하는 등 더 막강한 기능을 제공 합니다. gwak를 간단히 요약을 해보면 아래와 같습니다.

■ 데이터를 저장하기 위한 변수 사용

■ 산술 연산 및 스트링 조작 가능

■ 구조화된 프로그래밍 사용 가능

■ 형식화된 보고서 생성

gawk 명령어 형식

명령어 형식은 아래와 같습니다. 그리고 사용가능한 option은 아래 테이블과 같습니다.

$gawk options program file

명령어 라인에서 프로그램 스크립트 읽어 들이기

gwak는 명령어 라인에서 스크립트를 읽어 들이기 위해 대괄호를 사용 합니다. 아래는 사용 예제 입니다.

$ gawk ’{print "Hello John!"}’

gwak는 따옴표로 시작해서 대괄호 안에 실행할 명령을 넣어 주고 대괄호를 닫고 따옴표를 찍어서 사용해야 됩니다.

위의 명령을 입력을 하면 사용자가 텍스트를 입력 후 엔터를 칠때마다 위의 명령이 실행이 됩니다.

$ gawk '{print "Hello Wold!"}'
this is a test ==> 한 라인을 입력 하고 엔터를 치면
Hello Wold! ==> gawk 명령이 실행 됩니다.
HELLO
Hello Wold!
this is another test
Hello Wold!
Ctrl +D ==> gawk에게 데이터 스트립의 끝을 알려 줍니다

데이터 필드 변수 사용하기

gawk는 데이터 스트림을 처리 하기 위해 자동으로 오래의 변수를 할당을 합니다.

■ $0 한개 라인 전체를 표시 합니다

■ $1 텍스트에서 첫번째 데이터를 표시 합니다

■ $2 텍스트에서 두번째 데이터를 표시 합니다.

■ $n 텍스트에서 n번째 데이터를 표시 합니다.

데이터 필드는 텍스트 라인에서 Field seperate charater에 의해 구분이 됩니다. 기본 데이터 필드 구분잦는 스페이스 입니다. 아래의 예제는 데이터 필드에서 첫번째 데이터를 프린트 하는 예제 입니다.

$ cat data3
One line of test text.
Two lines of test text.
Three lines of test text.
$ gawk ’{print $1}’ data3
One
Two
Three
$

그럼 이번에는 데이터 구분자를 콜론으로 변경하고 /etc/passwd 파일의 첫번째 데이터를 읽어 보도록 하겠습니다.

$ gawk -F: ’{print $1}’ /etc/passwd
root
bin
daemon
adm
lp
sync
shutdown
halt
...

프로그램 스크립트에서 여러개 명령어 사용하기

gawk에서 여러개의 명령을 사용하려고 하면 세미콜론으로 명령어 사이에 붙여 주면 됩니다. 아래의 예제를 봅시다.

반응형
$ echo "My name is Rich" | gawk ’{$4="Dave"; print $0}’
My name is Dave
$

위의 명령은 echo로 실행되는 출력문 중 4번째 데이터 필드를 Dave로 변경후에 한개의 라인을 출력해 줍니다.

아래는 sed와 같이 두번째 프롬프트에 프로그램 스크립트를 아래와 같이 입력할 수 있습니다.

$ gawk ’{

> $4="testing"

> print $0 }’

This is not a good test.

This is not testing good test.

$

파일로 부터 프로그램 읽어 들이기

sed 에디터와 같이 gawk는 프로그램을 파일에 입력 시켜 놓고 파일을 불러 들여 명령어 라인에서 실행하게 할수 있습니다. 아래는 파일로 부터 읽어 들이는 예제 입니다.

$ cat script2 ==> 스크립트 2파일에 명령을 입력 합닏.
{ print $5 "’s userid is " $1 } ==> 5번째 데이터를 불러 들이고 user id와 첫번째 데이터를 출력 합니다.
$ gawk -F: -f script2 /etc/passwd==> 데이터 구분을 :로 , script2를 불러 들이고 /etc/passwd에서 실행
root’s userid is root
bin’s userid is bin
PostgreSQL Server’s userid is postgres
FTP User’s userid is ftp
GDM User’s userid is gdm
HTDIG User’s userid is htdig

여러개의 명령을 파일에 입력을 하고 실행도 할수 있습니다. 아래 예제를 살펴 봅시다.

$ cat script3
{
text="’s userid is " 명령어 구분을 위해 세미콜론을 사용할 필요가 없습니다.
print $5 text $1
}
$ awk -F: -f script3 /etc/passwd | more
root’s userid is root
bin’s userid is bin
PostgreSQL Server’s userid is postgres
FTP User’s userid is ftp
GDM User’s userid is gdm
HTDIG User’s userid is htdig
Dhcpd User’s userid is dhcpd
Bind User’s userid is named
NSCD Daemon’s userid is nscd
X Font Server’s userid is xfs
MySQL server’s userid is mysql
Rich’s userid is rich
test account’s userid is testing
postfix’s userid is postfix
$

데이터 처리 전에 시크립트 실행 시키기

gawk는 보통 데이터처리를 먼저 하고 gawk 명령을 실행을 시킵니다. 하지만 가끔 스크립트를 먼저 실행을 시킬때가 필요한데, 이때 상요하는 구문이 begin 명령어 입니다. 아래는 begin 사용 예제 입니다.

$ gawk ’BEGIN {print "Hello World!"}’
Hello World!
$

이 구문은 데이터를 처리 하기 전에 "Hello World"를 출력을 시켜 줍니다.

END 명령어 사용하기

begin과 달리 END명령은 데이터 처리 후에 마지막으로 스크립트를 실행 시키게 해 줍니다. 아래 예제를 살펴 보도록 하겠습니다.

$ gawk ’BEGIN {print "Hello World!"} {print $0} END {print "byebye"}’
Hello World!
This is a test
This is a test
This is another test.
This is another test.
byebye
$

이 번에는 BEING과 end를 사용하는 하나의 좋은 예제를 살펴 보도록 하겠 습니다.

$ cat script4 ==> script4를 살펴 봅시다.
BEGIN {
print "The latest list of users and shells"
print " Userid Shell"
print "-------- -------"
FS=":"
}
{print $1 " " $7}
END {print "This concludes the listing"}
이제 명령을 실행 시켜 봅시다.
$ gawk -f script4 /etc/passwd
hyowon@hyowon-800G5M-800G5W:~$ gawk -f script4 /etc/passwd
The latest list of users and shells
Userid Shell
-------- -------
root /bin/bash
daemon /usr/sbin/nologin
bin /usr/sbin/nologin
sys /usr/sbin/nologin
sync /bin/sync
games /usr/sbin/nologin
man /usr/sbin/nologin
lp /usr/sbin/nologin
mail /usr/sbin/nologin

2. sed 에디터 기본

sed 데이터를 잘 쓰는 방법은 다양한 명령어와 포맷을 아는 것 입니다. sed의 기본 명령어와 기능들을 알아 보도록 하겠 습니다.

Subsitution flags

아래의 예제를 살표 보도록 합시다.

$ cat data4
This is a test of the test script.
This is the second test of the test script.
$ sed ’s/test/trial/’ data4
This is a trial of the test script.
This is the second trial of the test script. $

sed 's/test/trial 구문이 잘 동작 하는것 처럼 보입니다 .하지만 한개의 라인에 한개의 단어만 교체를 하고 두번째는 교체를 하지 않는것을 볼수 있습니다. 이때 sunstitution flags를 사용하면 좀더 구체적으로 조작을 할수가 있습니다. 아래은 사용 가능한 flag들 입니다.

■ 숫자: flag값에 숫자를 넣으면 몇번째 문자를 교체를 할건지 정의 할수 있습니다.

■ g : 한 라인에 나타나는 모든 문자를 교체를 합니다.

■ p : 원래 문자열에서 패턴과 매치된는 문장을 출력 합니다.

■ w file : 결괄르 파일에 저장을 합니다.

$ cat test
This is a test of the test script.
This is the second test of the test script.
$ sed ’s/test/trial/2’ test ==> test파일에서 각 라인의 2번째 test를 trial 로 교체 합니다.
This is a test of the trial script.
This is the second test of the trial script.
$
$ sed ’s/test/trial/g’ test ==> test 파일내의 모든 test를 trial로 교체 합니다.
This is a trial of the trial script.
This is the second trial of the trial script.
$
$ cat test
This is a test line.
This is a different line.
$ sed -n ’s/test/trial/p’ data5 -n 옵션은 sed의 출력 결과를 생략 하고 -p flag는 변경된 라인을 표시
This is a trial line.
$
$ sed ’s/test/trial/w test’ result ==> test파일에서 매치되는 문장을 변경후 result 파일에 저장
This is a trial line.
This is a different line.
$ cat result
This is a trial line.
$

문자들 교체 하기

아래의 예제는 파일에서 경로를 변경하는 경우를 표시한 예제 입니다. 이때 문자열 구분자로 '!"를 사용 합니다.

$ sed ’s!/bin/bash!/bin/csh!’ /etc/passwd ==> /etc/passwd의 파일의 shell을 csh로 변경

Addressing 사용하기

한개의 파일안에서 특정 라인이라 특정 그룹만 변경을 하고 싶을 경우가 있습니다. 이때 사용할 수 있는것이 addressing 입니다. Addressing 하는 방법은 숫자를 이용하는 경우와 문자 패턴을 이용하여 라인을 필터링 하는 경우가 있습니다.

아래는 숫자를 이용하는 예제 입니다.

$ sed ’2s/dog/cat/’ data1 ==> data1파일의 2번째 라인에만 적용
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy cat ==> dog가 cat으로 변경됨
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog $
$ sed ’2,3s/dog/cat/’ data1
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy cat
The quick brown fox jumps over the lazy cat
The quick brown fox jumps over the lazy dog
$
$ sed ’2,$s/dog/cat/’ data1 ==> 2번째 라인부터 끝라인까지 적용할때 $를 사용 합니다.
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy cat
The quick brown fox jumps over the lazy cat
The quick brown fox jumps over the lazy cat
$

텍스트 패턴 필터 이용하기

특정한 패턴을 가진 텍스트의 일부분을 텍스트 패턴 필터를 사용해 변경을 할수가 있습니다.

그 사용 방법은 아래의 예제와 같습니다.

$ sed ’/rich/s/bash/csh/’ /etc/passwd ==> etc/passwd파일에 rich 사용자의 shell을 변경
rich:x:500:500:Rich Blum:/home/rich:/bin/csh barbara:x:501:501:Barbara:/home/barbara:/bin/bash katie:x:502:502:Katie:/home/katie:/bin/bash
jessica:x:503:503:Jessica:/home/jessica:/bin/bash
test:x:504:504:Ima test:/home/test:/bin/bash $

명령어 그룹핑 하여 사용하기

한개의 라인에 여러개의 문자를 변경하고 싶을 경우가 있습니다 .이때에는 중괄호를 사용하여 명령어를 묶어서 아래와 같이 변경을 하면 됩니다.

$ sed ’2{ ==> 2번째 라인에 적용
> s/fox/elephant/ ==>fox를 elephant로
> s/dog/cat/ ==> dog를 cat으로
> }’ data1
The quick brown fox jumps over the lazy dog.
The quick brown elephant jumps over the lazy cat.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
$
$ sed ’3,${ ==> 3번째 라인에서 끝까지 적용
> s/brown/green/ ==> brown을 green으로
> s/lazy/active/ ==> lazy를 active로 변경
> }’ data1
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick green fox jumps over the active dog.
The quick green fox jumps over the active dog.
$

라인 지우기

sed에서 문자를 교체 하는것 말고도 특정 문자를 지울 수도 있습니다. 지우는 명령은 'd' 입니다.

$ sed ’d’ data1 ==> data1 파일 전체를 삭제
$ sed ’3d’ data6 ==> data6 파일의 3번째 라인 삭제
This is line number 1.
This is line number 2.
This is line number 4.
$
$ sed ’2,3d’ data6 ==> 2번째와 3번째 라인 삭제
This is line number 1.
This is line number 4.
$
$ sed ’3,$d’ data6 ==> 3번째 라인부터 끝까지 삭제
This is line number 1.
This is line number 2.
$
$ sed ’/number 1/d’ data6 ==> number 1이 있는 라인 삭제
This is line number 2.
This is line number 3.
This is line number 4.
$

지금까지 삭제하는 명령을 배웠습니다. 다만 기억해야 할것은 d명령으로 삭제한 것은 sed 에디터에서 삭제가 된 것이고 실제 파일에서는 삭제가 되지 않는다 라는 것을 기억해야 합니다.

데이터 패턴 2개를 이용하여 삭제 하기

데이터 패턴 2개를 이용하여 지우기 시작과 지우기 마지막을 정의를 할 수가 있습니다.

$ sed ’/1/,/3/d’ data6 ==. 텍스트 패턴 2개를 이용해 지우기 첫번째 1이 지우기 시작, 두번째 3이 마지막.
This is line number 4.
$
$ cat data7
This is line number 1.
This is line number 2.
This is line number 3.
This is line number 4.
This is line number 1 again.
This is text you want to keep.
This is the last line in the file.
$ sed ’/1/,/3/d’ data7
This is line number 4.
$
위의 명령어 실행결과가 line number 4만 남은 이유는 line number 1 again문장에서 다시 지우기가 시작이 되고 끝날때까지 지우기가 종료되는 3번을 찾지 못했기 때문에 파일의 끝까지 모두 데이터를 지웁니다.

삽입과 텍스트 추가 하기

sed도 다른 에디터와 마찬 가지로 삽입과 추가가 가능 합니다. 아래의 옵션들을 참고 하시기 바랍니다.

■ i : 특정라인 앞에 새로운 라인을 삽입 합니다.

■a : 특정라인 뒤에 새로운 라인을 추가 합니다.

명령어 포맷은 아래와 같습니다.

sed ’[address]command\ new line’

$ echo "testing" | sed ’i\ ==> testing 앞라인에 삽입을 합니다.
> This is a test’
This is a test
testing
$
$ echo "testing" | sed ’a\ ==> testing뒤에 문장을 추가 합니다.
> This is a test’
testing
This is a test
$
$ sed ’3i\ ==> 3번째 문장 앞에 아래의 문장을 추가 합니다.
> This is an inserted line.’ data6
This is line number 1.
This is line number 2.
This is an inserted line.
This is line number 3.
This is line number 4.
$
$ sed ’3a\ ==> 3번째 라인뒤에 아래의 문장을 추가 합니다.
>This is an inserted line.’ data6
This is line number 1.
This is line number 2.
This is line number 3.
This is an inserted line.
This is line number 4.
$
$ sed ’$a\ ==> '$' 기호는 라인의 마지막을 뜻 합니다. 아래의 문장을 마지막 라인에 추가.
> This is a new line of text.’ data6
This is line number 1.
This is line number 2.
This is line number 3.
This is line number 4.
This is a new line of text.
$
$ sed ’1i\ ==> 첫번째 라인에 아래의 2문장을 삽입 하기.
> This is one line of new text.\
> This is another line of new text.’ data6
This is one line of new text.
This is another line of new text.
This is line number 1.
This is line number 2.
This is line number 3.
This is line number 4.
$

라인 변경하기

라인을 변경하는 명령은 'c' 입니다. c 명령을 통해 라인을 새로운 라인으로 변경을 할 수 있습니다.

아래 예제를 보겠습니다.

$ sed ’3c\ ==> 3번째 라인을 아래의 문장으로 변경을 합니다.
> This is a changed line of text.’ data6
This is line number 1.
This is line number 2.
This is a changed line of text.
This is line number 4.
$
$ sed ’/number 3/c\ ==> number 3의 패턴이 있는 라인을 아래의 문장으로 변경 합니다.
> This is a changed line of text.’ data6
This is line number 1.
This is line number 2.
This is a changed line of text.
This is line number 4.
$
$ sed ’2,3c\ ==> 2번째와 3번째 라인을 변경을 합니다.
> This is a new line of text.’ data6
This is line number 1.
This is a new line of text.
This is line number 4.
$
$ sed ’y/123/789/’ data7 ==> 1을 7로 2를 8로 3을 9로 변경을 합니다.
This is line number 7.
This is line number 8.
This is line number 9.
This is line number 4.
This is line number 7 again.
This is yet another line.
This is the last line in the file.
$
$ echo "This 1 is a test of 1 try." | sed ’y/123/456/’ ==> 1을 4로 2를 5로 3을 6으로 변경 합니다.
This 4 is a test of 4 try.
$

라인 프린트 하기

프링팅 명령어는 sed 에디터가 변경하는 라인들을 출력을 시켜 줍니다. 그 옵션은 아래와 같습니다.

■ p: sed가 편집하는 라인을 프린트 합니다.

■ = : 라인의 번호를 출력해 줍니다. command to print line numbers

■ l : 라인을 리스트 업해 줍니다.

$ sed -n ’/number 3/p’ data6 ==> number 3에 매칭되는 라인을 출력해 줍니다.
This is line number 3.
$
$ sed -n ’2,3p’ data6 ==> 2번 라인과 3번 라인을 출력해 줍니다.
This is line number 2.
This is line number 3.
$
$ sed -n ’/3/{ ==> 패턴이 3인 라인을
p ==> 변경전에 출력을 하고
s/line/test/p }’ data6 ==? line을 test로 변경 후 출력 합니다.
This is line number 3.
This is test number 3.
$

러안번호 출력하기

'=' 명령은 라인의 번호를 출력을 해 줍니다. 아래 예를 살펴 보겠 습니다.

$ sed ’=’ data1
1
The quick brown fox jumps over the lazy dog.
2
The quick brown fox jumps over the lazy dog.
3
The quick brown fox jumps over the lazy dog.
4
The quick brown fox jumps over the lazy dog.
$
$ sed -n ’/number 4/{ ==> 패턴이 number 4인 문장을
= ==> 라인을 표시하고
p ==> 출력을 한다.
}’ data6 4
This is line number 4.
$

출력되지 않는 캐릭터 출력하기

'l' 옵션은 파일안에 text와 출력되지 않는 내용도 같이 출력을 해 줍니다. 아래 예제를 통해 살펴 보도록 합니다.

$ cat data8
This line contains tabs.
$ sed -n ’l’ data8
This\tline\tcontains\ttabs.$ $
\t는 tab 문자를 보여 주고, 마지막 $ 케릭터는 라인의 끝을 보여 줍니다.
$ cat data9
This line contains an escape character
$ sed -n ’l’ data9
This line contains an escape character \033[44m$ $
\033[44ㅡ$는 escape code를 보여 줍니다.

sed에서 파일을 이용하기

'w' 명령어는 라인을 파일에 쓸때 사용할 수 있습니다. 사용구문은 아래와 같습니다.

[address]w filename ==> filename은 상대경로와 절대 경로 모두를 이요할 수 있습니다.

$ sed ’1,2w test’ data6 ==> data6파일의 첫번째에서 두번째 라인을 test파일에 저장을 합니다.
This is line number 1.
This is line number 2.
This is line number 3.
This is line number 4.
$ cat test
This is line number 1.
This is line number 2.
$

파일로 부터 데이터를 읽어 들여 라인에 추가 하기

다른 파일에서 라인을 읽어 들어서 현재 편집중인 파일에 추가를 할수도 있습니다. 이때 사용하는 명령은 'r'입니다.

사용하는 구문은 아래와 같습니다. 그리고 r 명령어에서는 텍스트 패턴이나 라인 번호만 사용이 가능하고 라인의 범위를 지정할 수는 없습니다.

[address]r filename

$ cat data1
This is an added line.
This is the second added line.
$ sed ’3r data1’ data6 ==> data6파일의 3번째 라인 다음에 data1 파일을 추가 합니다.
This is line number 1.
This is line number 2.
This is line number 3.
This is an added line.
This is the second added line.
This is line number 4.
$
$ sed ’/number 2/r data11’ data6 ==> data6파일에 number2패턴 다음에 data11의 라인을 추가 한다.
This is line number 1.
This is line number 2.
This is an added line.
This is the second added line.
This is line number 3.
This is line number 4.
$
$ sed ’$r data11’ data6 ==> data6 파일의 마지막에 data11의 내용을 추가 한다.
This is line number 1.
This is line number 2.
This is line number 3.
This is line number 4.
This is an added line.
This is the second added line.
$
letter파일의 내용을 봅시다.
$ cat letter
Would the following people:
LIST
please report to the office.
$
data10파일의 내용을 보면
$ cat data10
Blum, Katie Chicago, IL
Mullen, Riley West Lafayette, IN
Snell, Haley Ft. Wayne, IN
Woenker, Matthew Springfield, IL
Wisecarver, Emma Grant Park, IL
$
여기서 LIST패턴을 활용해 DATA 10에 있는 참가자 명단을 letter파일에 집어 넣습니다.
$ sed ’/LIST/{
> r data10 ==> 참가자 명단이 있는 data10 파일을 읽어 들입니다.
> d ==> data10에 있는 LIST를 삭제 합니다.
> }’ letter
Would the following people:
Blum, Rich Chicago, IL
Mullen, Riley West Lafayette, IN Snell,
Haley Ft. Wayne, IN Woenker,
Matthew Springfield, IL
Wisecarver,
Emma Grant Park, IL
please report to the office. $

오늘도 고생 하셨습니다. Shell Script 전문가가 되는 그날까지 힘내시길 바랍니다.

728x90
반응형

'쉘스크립트' 카테고리의 다른 글

진화된 sed  (1) 2022.07.06
정규 표현식  (2) 2022.07.06
스크립트에서 그래픽 사용하기  (1) 2022.07.06
함수 만들기  (1) 2022.07.06
스크립트 제어  (1) 2022.07.06