본문 바로가기

전체 글221

sed나 awk 대신에 parameter substitution 를 이용하자 string="TestT100String" echo ${string//[^[:digit:]]/} 결과 Summary: String Manipulation and Expanding Variables For your ready references here are all your handy bash parameter substitution operators. Try them all; enhance your scripting skills like a pro: ${parameter:-defaultValue} Get default shell variables value ${parameter:=defaultValue} Set default shell variables value ${parameter:?"Error M.. 2021. 7. 15.
ps에서 grep 적용할때 자신 프로세스 제거하기위해 -v옵션을 이용한다. xaiops@solaris-32:~/sentry_solaris_2106$ ps -ef |grep araqne xaiops 21264 27281 0 20:44:09 pts/13 0:00 grep araqne xaiops@solaris-32:~/sentry_solaris_2106$ ps -ef |grep -v grep| grep araqne xaiops@solaris-32:~/sentry_solaris_2106$ -v옵션을 이용한다. |grep -v grep 을 중간에 추가하여 제거한다. 2021. 7. 15.
쉘스크립트 별 지원하는 grep 옵션 https://recipes4dev.tistory.com/157 리눅스 grep 명령어 사용법. (Linux grep command) - 리눅스 문자열 검색 1. grep 명령어. grep은 입력으로 전달된 파일의 내용에서 특정 문자열을 찾고자할 때 사용하는 명령어입니다. 리눅스에서 가장 많이 사용되는 명령어 중 하나이죠. 하지만 grep 명령어가 문자열을 recipes4dev.tistory.com 2021. 7. 14.
쉘 스크립트 변수에 기본값 설정하기 http://web.deu.edu.tr/doc/oreily/unix/ksh/ch04_03.htm [Chapter 4] 4.3 String Operators If varname exists and isn't null, return its value; otherwise print varname: followed by message, and abort the current command or script. Omitting message produces the default message parameter null or not set. web.deu.edu.tr 2021. 7. 14.
쉘에서 패턴매칭시 판별시 =~ 대신에 == 사용하기 http://www.kornshell.com/doc/faq.html KSH-93 - Frequently Asked Questions www.kornshell.com 2021. 7. 14.
Log4J2 패턴작성에 스타일 적용하기 https://velog.io/@bread_dd/Log4j-2-%EC%A0%9C%EB%8C%80%EB%A1%9C-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0-%EA%B0%9C%EB%85%90 Log4j 2 제대로 사용하기 - 개념 log4j2.xml이전 글에서 log4j 2 설정파일을 보여드렸는데요, 각각의 요소가 뭘 의미하는지 알아보도록 할게요Configuration은 로그 설정의 최상위 요소입니다. 일반적으로 Configuration은 Properties, Appenders, velog.io Property name="layoutPattern">%style{%d{yyyy/MM/dd HH:mm:ss,SSS}}{cyan} %highlight{[%-5p]}{FATAL=bg_red, E.. 2021. 7. 14.
ksh 에서 백스페이스나 tab자동완성 적용하는 방법 급할땐 stty erase ^? AIX 터미널에서 백스페이스 작동 안할때 해결방법 안녕하세요, 우리노트 Benjamin입니다. AIX작업을 하다보면 백스페이스가 제대로 먹지 않는 경우가 있습니다. 백스페이스 입력 때 ^? 가 입력 되시는 경우가 대표적인데요, 터미널 환경 문제때문 ournotes.tistory.com https://ournotes.tistory.com/136 2021. 7. 9.
유닉스에서 사용자 계정생성시 알아야 할 것 https://choseongho93.tistory.com/126 [리눅스] 사용자계정생성 옵션&명령어 (사용자생성 - useradd & 사용자계정 정보보기) ◆ 현재 우리는 관리자이기때문에 일반 사용자에 대해서 수정,삭제,생성 등을 할 실습을 하기위해 처음 리눅스 설치할때 만든 사용자로 사용해보겠습니다 ! 우선, 빨간색처럼 tail /etc/passwd ( 사 choseongho93.tistory.com https://itdexter.tistory.com/414 Solaris - 사용자 계정(useradd, usermod, passwd) 1. useradd 명령어 useradd [-u uid] [-g, -G group] [-d dir] [-s shell] [-k skel_dir] [-f inactive.. 2021. 7. 7.
mac에서 aws ec2로 scp 사용하기 scp -i ../aws-internals.pem logpresso-ENT-3.10.2106.0-u2379.zip centos@ec2-1124-88-11.ap-northeast-2.compute.amazonaws.com:~/ 2021. 7. 5.
here-doc스타일로 배쉬에서 파이썬으로 명령어결과나 변수 전달하기 https://unix.stackexchange.com/questions/74244/hybrid-code-in-shell-scripts-sharing-variables Hybrid code in shell scripts. Sharing variables This answer discusses how to run a multi-line Python snippet from the command line in a terminal. I noticed that the answer works great within shell scripts, even with nested indentation, which is ... unix.stackexchange.com 2021. 6. 15.