글

라벨이 Shell인 게시물 표시

ctags 팁 : ctagsignore

서론 ctags는 아직 구닥다리 개발자에게 소중한 툴입니다. 다만 ignore 기능이 있는지 모르고 사용하다보니 꽤 불편했었는데, 날잡아서 찾아봤습니다. RTFM (Read the fxxking manual) 진작 좀 man 페이지 볼껄.. 결론은 아래에 있습니다. exclude 옵션        --exclude=[pattern]             Add  pattern  to  a list of excluded files and directories. This option may be specified as many times as desired. For each file name considered by ctags, each pattern specified using this option will be compared against both the complete path (e.g. some/path/base.ext) and the base name (e.g. base.ext) of the file, thus allowing patterns which match a             given file name irrespective of its path, or match only a specific path. If appropriate support is available from the runtime library of your C compiler, then pattern may contain the usual shell wildcards (not regular expressions) common on Unix (be sure to quote the option parameter to protect the wildcards from being expanded by the shel...

make 로그를 파일에 기록하면서 화면에 출력하기. Shell 명령어 tee

요약 make 로그를 파일에 기록하면서 화면에 출력하려면 아래 명령을 실행하면 됩니다. make 2>&1 | tee -a make.log Situation 큰 프로젝트를 컴파일 하는데 컴파일 로그를 분석해야했습니다. 로그가 엄청난 양이 발생하니 파일로 기록해야 분석할 수 있었고, 컴파일 진행상황도 알아야하니 화면으로 출력도 해야했습니다. Task make 출력 로그를 기록 기존의 화면 출력 로그 유지 Action 스크립트 한줄이지만, 알아야할 개념이 이렇습니다. Redirect and Pipe 표준 입출력 : stdin, stdout, stderr tee 각각의 개념에 대해 블로깅을 하게 되면 링크를 달기로 하고, 이번에는 make의 출력과 tee 사용법에 대해서 말씀드리도록 하겠습니다. make 일단 make를 하면 컴파일 로그들이 출력됩니다.  $ make ccache g++ -std=c++11 -Wall main.cpp -oleetcode -lgtest -lpthread main.cpp: In member function ‘std::string Solution::longestPalindrome(std::string)’: make 출력후 나오는 로그가 같은 로그(?)가 아닙니다. ccache로 시작하는 로그는 stdout, 이탤릭체는 stderr입니다.  그래서 make > build.log 를 하면 stdout 만 build.log에 기록되는 것입니다. stderr 을 stdout 으로 보내면 해결되겠죠? make 2>&1 > build.log tee 명령어 사용법 위의 명령을 실행하면 문제가 stdout을 build.log에 리다이렉트하므로 화면에 출력하는 내용이 없습니다. make 현재 상황을 알 수 없는거지요. 이때 필요한 명령이 tee입니다. $ make stdin -> tee -> stdout         ...

Linux, Shell Script 글모음

Tip ssh로 쉘스크립트 돌리기   Shell 에서 파일의 full path 출력하는 방법 Linux Bash 팁 : find로 찾은 파일들 복사하기 리눅스 멀티코어를 사용하는 tar 압축/해제 make 로그를 파일에 기록하면서 화면에 출력하기. Shell 명령어 tee Ubuntu 20.04 에 D2Coding 폰트 설치 우분투 기본 쉘 dash 에서 bash로 변경하기 우분투 20.04 tftp 서버 설정 우분투 스압 메모리

Shell 에서 파일의 full path 출력하는 방법

잡설 간단한 팁이지만 올리는 이유는 제 바보짓을 널리 알리기 위해서 입니다...읭? 그동안 파일의 위치에 가서 pwd를 하고 파일명을 덧붙이는 개삽질을 해오다가 문득 "내가 왜 이런 바보짓을 하고 있지?" "형님들이 이미 만들어놨을거야"라며 검색해보니 바로 나오네요. $ realpath .bashrc /home/sjpark/.bashrc #바보짓은이제그만 #간단하지만유용한팁

이 블로그의 인기 게시물

구글 시트에 여러 행 한번에 추가하기

WSL2 Ubuntu 20.04 및 네트워크 설정

우분투 terminator 에서 파일 경로 클릭시 vscode 에서 열기