유닉스쉘 if -a 구문...펌
/etc/shell -> chsh /bin/tcsh
토큰, 대화형 기능, 작업환경, 시그널을 처리한다.
PID1의 init 프로세스 (inittab) -> /bin/loging -> /bin/sh -> /etc/profile -> ~/.profile -> $
HOME,SHELL,USER,LOGNAME
globbing p:데이터,스택,스택포인터,레지스터,...
fork,wait,exec,exit
UID가 0이면 root가 된다.
setuid, setgid로 EUID,EGID를 바꿀 수 있다.
umask;값을 빼는 과정 : umask 022 777-022=755 666-022=644
chmod 755 file (755==rwxr_xr_x)
find / -name file -print 2>errors : bourn,korn
(find / -name file -print > /dev/tty) >& errors :c
#!/bin/sh
guestfile = /home/jody/ellie/shell/guests
if[! f"$guestfile"]
then
:1,$ s/\<[Tt]om\>/David/g
fi
==>단어가 T나 t로 시작해서 om으로 끝나는 단어를 전범위에서 찾아서 David로 전부 치환
/O*ve/ == ove,oove,ooove
1,$ s/\)([Oo]ccur\)ence/\1rence/g
==>Occurence나 occurence를 Occurrence, occurrence로 각각 치화
grep "-RTN." *.dat
1,$ s/\<<[A-Za-z]*>\>//g
egrep
#!/bin/sh
chmod +x myscript;
ls -lf myscript;
echo "$0 $1 and $2";
echo"$#";
for pal in Tom Dick Harry Joe
do
echo "Hi $pal"
done
#!/bin/sh
file=./testing
if [-d $file]
then
echo "$file is directory"
elif [-f $file]
then
if [-r $file -a -w $file]
then
elif [!-r -a!-w $file]
chmod +rw $file
fi
fi
bash
/etc/bashrc
/etc/profile
~/.bash_profile ~/.bash_login ~/.profile
~/.bashrc
cf. ~/.inputrc
echo $? 하면 처리결과코드가 나온다.
sed -n -e '1,3p' -e'/-RTN\./p' datafile
sed '/estern/{n;s/AM/Archie/;}' datafile
sed '/Lewis/{s/5/9/;q;}' datafile
patter space에서 hold space로
nawk '{print FILENAME,$0}' file1 file2 file3 > bundled
nawk '$1!=previous {close(previous); previous=$1};\
{print substr($0,index($0m"")+1)>$1}' bundled
stty erase ^h
env set
exec > /dev/tty