본문 바로가기

반응형

IT

(289)
KSH 스크립트의 기초 원문 : http://www.well.ox.ac.uk/~johnb/comp/unix/ksh.html 쉘타입의 정의 새로운 쉘스크립트를 만들때, 첫라인에 다음과 같이 써준다 다음: #!/usr/bin/ksh 정확한 ksh 의 위치를 써주어야 하며, 32 character 를 넘어가면 안된다. 첫라인에 써주는 이정의로, 아래쪽의 모든스크립트는 ksh 가 처리하게 된다. 정의를 해주지않으면, 유저의 기본 쉘환경으로 지정된 쉘이 처리한다. 하지만 약간씩 다른 syntax 가 있기 떄문에 정확한 정의가 꼭 필요하다 4가지 종류의 행 스크립트는 4가지 종류의 라인정의가 있다: 최상단의 쉘정의 라인, 공란 라인, #으로 시작하는 주석 라인, 명령어라인. 아래의 예제를 보자: #!/usr/bin/ksh # Commen..
bc - 명령행 계산기 bc - arbitrary-precision arithmetic language 간단한 명령행수식으로 계산가능 ex) $> print "n=1;for(i=1;i
uniq 중복항목 제거 uniq [-udc [-f fields] [-s chars] [input_file [output_file]] input_file 생략시 output_file 생략시 으로 출력 중복된 항목을 제거하여 출력해줌-c 옵션 사용시 중복항목 카운트 해줌 ex)사용할 데이터 파일#test.dat1123456789101112131415 $> uniq test.dat123456789101112131415 $> uniq -c test.dat 2 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15
perl의 실행 옵션 간단한 1라인 스크립트를 테스트하고자할때, -e 옵션을 사용하면 편하다. $> perl -e '$ls = system("ls"); print "Result: $ls\n"' 그외, perl 의 옵션을 설명해 놓은 글 http://thdnice.tistory.com/49
core 파일 생성 감시하여, 내용 덤프후 파일 무브 #!/usr/bin/ksh #기록파일의 초기화 cat /dev/null > CoreList.lst cat /dev/null > Core_Batch_List.lst #반복작업 while true do #파일 감시 -f 파일여부 if [ -f /bin/core ] then sleep 5 #명령어를 실행전에 더미로 한번씩 더 실행함 file /bin/core filename=`file /bin/core | awk '{print substr($7,4,length($7)-4)}'` echo "core file:" $filename chmod 777 /bin/core date +%H_%M_%S_%Y_%m_%d core_name="/bin/core-real-"$filename"-"`date +%Y%m%d-%H%M%S..
파일읽기 *. 펄에서 파일읽기 참조링크 : http://gypark.pe.kr/wiki/Perl/%ED%8C%8C%EC%9D%BC #!/usr/bin/perl use strict; use warnings; my $file_name = "joblist.txt"; my $count = 0; open my $fh,"
foreach 의 사용 #!/usr/bin/perl @arrString = ("aaa","bbb","ccc"); foreach (@arrString) { print $_ ."\n"; } //jdk1.5+ public class ForEach { public static void main(String[] args) { String[] arr = {"aaa","bbb","ccc"}; for( String str : arr ) { System.out.println(str); } } } java 쪽을 자꾸 까먹기도 해서 비교 로 올림-ㅅ-''
오라클 버젼확인 방법 select * from v$version; *. 결과-- Banner -- Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit ProductionPL/SQL Release 9.2.0.8.0 - ProductionCORE9.2.0.8.0ProductionTNS for HPUX: Version 9.2.0.8.0 - ProductionNLSRTL Version 9.2.0.8.0 - Production Oracle Client 9i --> Oracle 11g 접속 가능하군~!

반응형