Contents

Views 11249 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

유닉스 시스템에서는

    % cp *.c  *.pas

같은 명령어를 사용할 수 없다.

유닉스에서는 메타문자(*, ? 등)가 해당되는 문자로 확장되서 작동되기 때문이다.


유닉스에서 이런 단점을 극복하기 위해서 

    % mmv *.c  .pas 

과 같이 작동하는 쉘스크립트를 작성해보자.


# mmv 코드

#!/usr/bin/csh
# usage : % mmv  *.c  .pas
 
set num=$#argv
set rd=$argv[$num]
echo $rd |set ex=`cut -d. -f2`
set i=1
 
while ($i < $num)
    echo $1 |set name=`cut -d. -f1 `
    set name2=$name'.'$ex
    echo "name2 ="$name2
    mv $1 $name2
    shift
    @ i +=1
end


[참고] https://hooni.net/578


?

List of Articles
No. Category Subject Author Date Views
861 System/OS [linux] 특수문자 환경 설정(stty) hooni 2003.04.23 15280
860 System/OS [linux] 텔넷, FTP 텍스트 모드에서 사용 hooni 2003.04.23 11940
859 System/OS [linux] 터미널에서 문자 깨질 때 설정 ㅋㅋ hooni 2003.04.23 13914
858 System/OS [linux] 콘솔/Xwindow 에서 PC스피커 소리 없애기 hooni 2003.04.23 16352
857 System/OS [linux] 콘솔 기본언어 설정 방법 hooni 2013.04.23 12827
856 System/OS [linux] 커널 컴파일, 설정 hooni 2003.04.23 17846
855 System/OS [linux] 최소한의 커널 설정(커널설치 전체과정) hooni 2003.04.23 17404
854 System/OS [linux] 초간단 SquirrelMail 설치/설정 (다람쥐 메일) hooni 2017.12.11 4464
853 System/OS [linux] 초간단 Postfix, Covecot, SSL/TLS (SMTP) file hooni 2017.12.11 9330
852 System/OS [linux] 처음 설치부터 APM 설치까지 (업데이트 할 것) hooni 2013.04.23 38271
851 System/OS [linux] 종료와 종료코드 확인(환경변수에서) hooni 2003.04.23 15546
850 Develop [linux] 임베디드 리눅스 (embedded linux) file hooni 2013.04.23 7354
Board Pagination Prev 1 ... 22 23 24 25 26 27 28 29 30 31 ... 98 Next
/ 98