본문 바로가기

Project & Module/Shell

[Unix Shell] 아규먼트 파싱 쉘 https://gist.github.com/jehiah/855086 참조 #!/bin/sh # # a simple way to parse shell script arguments # # please edit and use to your hearts content # ENVIRONMENT="dev" DB_PATH="/data/db" function usage() { echo "if this was a real script you would see something useful here" echo "" echo "./simple_args_parsing.sh" echo "\t-h --help" echo "\t--environment=$ENVIRONMENT" echo "\t--db-path=$DB_PATH" e.. 더보기
[BashShell] vi, ls color 제거 1, ls color 제거https://www.cyberciti.biz/faq/how-to-turn-on-or-off-colors-in-bash/ 2. vi color 제거https://www.cyberciti.biz/faq/turn-on-or-off-color-syntax-highlighting-in-vi-or-vim/ vimrc 에 colorschema 없애거나 syntax off 시키면 됨. 더보기
procContentInFile 1. 프로그램 목적 : - 파일의 내용을 추가, 수정, 삭제 등 수행하는 Shell 2. Source 2.1 procFileContent.sh #!/bin/ksh################################################ Desc# ################################################ Import. ./deleteContentInFile.sh. ./addContentInFile.sh ################################################ Inputcontent = $1addedValue=$2file_name=$3 ################################################ logic#d.. 더보기
파일 수정 Shell Program 1. Title : 파일 수정 Shell Program 2. Purpose : 파일의 특정 내용을 수정하는 프로그램 3. 사용법 : 1) sh modifyFile.sh 명령어를 입력하면 필수 아규먼트와 옵션 아규먼트 안내가 나온다. 2) 설명대로 아규먼트를 넣어주면 실행이 됨. 3) 변경할 내용이 중복이면 변경할 내용의 특정행을 입력하도록 설정 4. Supplement point : 1) Backup 기능 2) 변경할 내용이 없을 때 예외 처리 modifyFile.sh #!/bin/ksh ### include shell ### . ./help.sh . ./util.sh #================================== Variable count=0 #======================.. 더보기