어쩌면 당연한걸지도 모르겠지만..
리눅스와 윈도우의 개행은 CR+LF / LF로 차이가 크다.

vi에서 보면
CR+LF는 ^M이 붙는데,
이로 인해서 쉘에서 인식을 제대로 못하고
실행을 못하는 문제가 생긴다.


bash에서는 문제가 없었던거 같은데.. 흐음..
아무튼 busybox에서 사용하는 ash의 경우에는 CR+LF의 경우에는
제대로 안되니 반드시 확인을 해야한다.


(이걸로 일주일 공쳤네 ㄱ-)
Posted by 구차니
Linux2009. 8. 6. 10:13
저번에 두번 정도 시스템 말아 먹은 강력한 녀석인데..
버그인지 모르겠지만

grep -rnI "keyworld" ./ > log.find

이런식으로 검색을 하면, 검색이 끝나지 않고 파일이 무한대로 커지는 문제가 있다.
저렇게 언제 끝나나 냅두고 있으면... 시스템 뻗으니 주의!!!
Posted by 구차니
제목이랑은 조금 심하게 다르지만..

busybox-1.10.1/networking/ping.c 의 소스를 보면
enum {
    DEFDATALEN = 56,
    MAXIPLEN = 60,
    MAXICMPLEN = 76,
    MAXPACKET = 65468,
    MAX_DUP_CHK = (8 * 128),
    MAXWAIT = 10,
    PINGINTERVAL = 1, /* 1 second */
};

라는 부분에 timeout 10초와 핑간격 1초가 정의되어 있다.
어짜피 alarm() 함수가 integer 만 받아서 소수점은 무리이므로
ping -c 를 이용하여 빠르게 핑 테스트는 힘들듯 하다.

다른 방법으로 접근을 하자면,
ping -c 1 ... ; ping -c 1 ...
이런식의 명령행으로 할 경우 1초 간격없이 빠르게 핑을 연속으로 보낼 수 있다.
Posted by 구차니

AVR Studio에서 읽은 us-technology.co.kr에서 판매하는 보드의 기본 퓨즈 비트 설정값이다.
CKOPT가 원래 체크 되어 있어야 했던거 같은데 흐음..
Posted by 구차니
하드웨어2009. 8. 4. 23:07
 

Socket 478 / LGA 775

보아하니.. 쿨링이 안되서 컴퓨터가 죽어 나는거 같은데..
쿨러를 교체하려고 하니 머가 먼지 하나도 모르겠다... (세상은 나를 기다려주지 않는건가!!!)
아무튼 CPU는 Pentium4 2.66Ghz 인데 아무리 찾아도 478용으로 나오는 쿨러가 아닌 생김새를 하기에
고심을 하다보니, LGA775라는 것이 나왔는데..


Socket 478용 쿨러 / LGA 775용 쿨러

이렇게 생김새가 다르다. 아무튼 지지대 모양 자체가 다르니 주의를 해야 할 듯.

[링크 : http://en.wikipedia.org/wiki/Socket_478]
[링크 : http://en.wikipedia.org/wiki/LGA_775]

'하드웨어' 카테고리의 다른 글

풀업 / 풀다운 저항(Pull up / Pull down register)  (4) 2009.08.13
프레스캇!  (10) 2009.08.07
VT-d  (0) 2009.07.30
multicast MAC Address  (2) 2009.07.02
MAC 어드레스는 48비트 앞은 OUI 뒤는?  (0) 2009.06.24
Posted by 구차니
개소리 왈왈2009. 8. 4. 22:14
리눅스 머신이 시끄러워서 파워 문제인줄 알았더니..
쿨링문제이거나, 다른 문제인것 같다.

예전에 250W 에서 350W로 올렸음에도 불구하고,
파워가 엄청 뜨겁다...

일단은 cpu 쿨링을 위해 써멀 구리스 부터 하나씩 차근차근 발라주어봐야겠다..
머.. micro-ATX 파워야, 콘덴서도 부풀어 있었으니 미리미리 갈아 주는게 좋았겠지?
(라고 자기 위안중)

'개소리 왈왈' 카테고리의 다른 글

프레스~~~~핫!! 2  (4) 2009.08.10
지 아이 조 - G.I.JOE (2009)  (4) 2009.08.08
질렀노라 긁었노라 왔노라!!!  (0) 2009.07.30
몸이 아프면!  (8) 2009.07.24
네이버 블로그 많이 변했네 & 이건 모하는 꼬꼬마?  (2) 2009.07.21
Posted by 구차니
Linux2009. 8. 4. 15:45
bash 쉘 스크립트에서 변수를 선언하는 방법은 다음과 같다.
VARIABLE=VALUE

그리고 변수를 읽는 방법은 다음과 같다.
VAR2=$VARIABLE

아무튼, 다른 변수에 변수들을 조합해서 내용을 넣는데
공백이 들어가는 문자열의 경우에는 한번에 변수로 들어가지 않는다.
$ test=123 456 789
-bash: 456: command not found

그런 이유로, 문자열은 " "로 넣어주어야 한다.
$ test="123 456 789"

' '는 안에 변수가 있다고 하더라도 치환하지 않고 그냥 출력한다.
$ test="123 456 789"
$ echo '$test'
$test

{}는 함수이다. 즉, 어떠한 내용을 변형 후 값으로 사용하려면 ${} 라고 하면된다.
()는 변수를 감싸준다. 그냥 $(VAR) 이런식으로 사용한다.

선언되지 않은 변수를 사용할 경우에는 null 문자이므로 출력되지 않으나(bash에서)
busybox(ver 1.10.1) 에서는 오작동을 하는 문제가 보였다.

예를 들어
VAR="test string $undefined hello world"를 출력하려고 하면
hello world만 나온다.


참고 링크
[링크 : http://kaludin.egloos.com/2334564]
[링크 : http://wiki.kldp.org/HOWTO//html/Adv-Bash-Scr-HOWTO/index.html]

'Linux' 카테고리의 다른 글

busybox route 명령어  (0) 2009.08.06
grep -r 옵션은 주의!  (0) 2009.08.06
bash - eval  (0) 2009.08.03
/proc/cmdline 내용 읽어오기  (0) 2009.08.03
setenv() - change or add an environment variable  (4) 2009.08.03
Posted by 구차니
프로그램 사용2009. 8. 3. 19:18
머.. libjpeg가 그랬듯이 libpng도 별 건 없다.

$ more INSTALL
Installing libpng version 1.2.38 - July 16, 2009

On Unix/Linux and similar systems, you can simply type
    ./configure [--prefix=/path]
    make check
    make install
and ignore the rest of this document.

$ ./configure --host=sh4-linux
configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for sh4-linux-strip... sh4-linux-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for sh4-linux-gcc... sh4-linux-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether sh4-linux-gcc accepts -g... yes
checking for sh4-linux-gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of sh4-linux-gcc... gcc3
checking build system type... i686-pc-linux-gnu
checking host system type... sh4-unknown-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by sh4-linux-gcc... /opt/STM/STLinux-2.2/devkit/sh4/sh4-linux/bin/ld
checking if the linker (/opt/STM/STLinux-2.2/devkit/sh4/sh4-linux/bin/ld) is GNU ld... yes
checking how to run the C preprocessor... sh4-linux-gcc -E
checking for sh4-linux-sed... /bin/sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for BSD- or MS-compatible name lister (nm)... /opt/STM/STLinux-2.2/devkit/sh4/bin/sh4-linux-nm -B
checking the name lister (/opt/STM/STLinux-2.2/devkit/sh4/bin/sh4-linux-nm -B) interface... BSD nm
checking the maximum length of command line arguments... 98304
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /opt/STM/STLinux-2.2/devkit/sh4/sh4-linux/bin/ld option to reload object files... -r
checking for sh4-linux-objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for sh4-linux-ar... sh4-linux-ar
checking for sh4-linux-strip... (cached) sh4-linux-strip
checking for sh4-linux-ranlib... sh4-linux-ranlib
checking command to parse /opt/STM/STLinux-2.2/devkit/sh4/bin/sh4-linux-nm -B output from sh4-linux-gcc object... ok
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if sh4-linux-gcc supports -fno-rtti -fno-exceptions... no
checking for sh4-linux-gcc option to produce PIC... -fPIC -DPIC
checking if sh4-linux-gcc PIC flag -fPIC -DPIC works... yes
checking if sh4-linux-gcc static flag -static works... yes
checking if sh4-linux-gcc supports -c -o file.o... yes
checking if sh4-linux-gcc supports -c -o file.o... (cached) yes
checking whether the sh4-linux-gcc linker (/opt/STM/STLinux-2.2/devkit/sh4/sh4-linux/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for ANSI C header files... (cached) yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for working strtod... no
checking for pow... no
checking for pow in -lm... yes
checking for memset... yes
checking for pow... (cached) no
checking for pow in -lm... (cached) yes
checking for zlibVersion in -lz... yes
checking if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE... yes
checking if libraries can be versioned... yes
checking for symbol prefix...
configure: pkgconfig directory is ${libdir}/pkgconfig
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libpng.pc
config.status: creating libpng-config
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

물론 크로스 컴파일이므로
make check는 "cannot execute binary file" 메시지를 출력하면서 중단된다.
Posted by 구차니
Linux2009. 8. 3. 17:31
eval [arg ...]
    The args are read and concatenated together into a single command.
    This command is then read and executed by the shell,  and its exit status is returned as the value of eval.
    If there are no args, or only null arguments, eval returns 0.

변수들을 합쳐주고, 실행까지 해준다고 한다.
export 명령어를 args에 넣고 하면 가능할 듯하다.
물론 child process를 생성해서 실행하게 되므로 export를 한다고 해도,
변수의 값이 변경되거나 생성되지는 않는다.(스크립트 종료와 함께 사라짐)

[링크 : http://www.unix.com/unix-dummies-questions-answers/43969-set-variable-awk-output.html]
Posted by 구차니
sed '/s/replace old/replace new/'
스트림이니까, 파이프로 연결해도 당연히(?!) 된다.

[링크 : http://www.grymoire.com/Unix/Sed.html]
Posted by 구차니