배치 스크립트 및 쉘 스크립트를 실행하다 보면, Redirect(> , >>)를 자주 사용하게 된다.

그런데 쉘 스크립트에서는 "2>&1" 를 활용하여, error 및 standard output을 파일 등에보내는 것은 잘 알려진 사실이었지만(내가 알고 있었지만), 윈도우즈 배치 스크립트에서도 똑같이 활용될 수 있다는 것을 오늘 처음 알았다.

 

역시 배움은 나의 힘!!! 

 

 

 

Redirection
command > file Write standard output of command to file
command 1> file Write standard output of command to file (same as previous)
command 2> file Write standard error of command to file (OS/2 and NT)
command > file 2>&1 Write both standard output and standard error of command to file (OS/2 and NT)
command >> file Append standard output of command to file
command 1>> file Append standard output of command to file (same as previous)
command 2>> file Append standard error of command to file (OS/2 and NT)
command >> file 2>&1 Append both standard output and standard error of command to file (OS/2 and NT)
commandA | commandB Redirect standard output of commandA to standard input of commandB
commandA 2>&1 | commandB Redirect standard output and standard error of commandA to standard input of commandB (OS/2 and NT)
command < file command gets standard input from file
command 2>&1 command's standard error is redirected to standard output (OS/2 and NT)
command 1>&2 command's standard output is redirected to standard error (OS/2 and NT)

 

이 글은 스프링노트에서 작성되었습니다.

Posted by 아프락사스

Windows PowerShell이 나와서 반갑다는 이야기를 쓴지가 5분이 되지 않았는데, 아래와 같은 슬픈 현실이...

 

http://www-01.ibm.com/support/docview.wss?rs=3099&context=SS2MGB&dc=DB560&dc=DB520&uid=swg21323061&loc=en_US&cs=UTF-8&lang=en&rss=ct3099rational

 

When PowerShell is called, a separate shell is created. Rational Build Forge is unable to access this shell and never receives a response from the agent's PowerShell process/shell. The step eventually times out in Rational Build Forge and the build fails.

 

PowerShell을 호출하면, 다른 쉘(즉 다른 프로세스)이 시작되기 때문에, Build Forge agent로서는 Return 코드를 받거나, 로그 스트림을 받아낼 수가 없다는 이야기다. 결국, 맨 처음 호출된 PowerShell 프로세스로 부터는 아무런 응답을 받지 못하고, TMO가 발생한다는 이야기다.

 

BF의 잘못인가? 아님 PowerShell 아키텍처가 잘못 된 것인가.

 

내가 보기에는 Windows 아키텍처 상 PowerShell에서 단일 프로세스로 스크립팅을 처리할 수 없기 때문이 아닐까 싶다.

윈도우의 기본 명령어 인터프리터(일명, CMD)에서 PowerShell script를 처리하지 못하고, PowerShell 인터프리터 프로세스를 새로 띄움으로서 발생하는 치명적인 약점인 것이다.

 

BF의 다음버전에서는 이를 반영할 수 있을까? MS가 수정할 것 같지도, 수정할 수 있을 것 같지도 않으니 말이다.

 

그나마, 링크된 문서에 따르면 workaround로 VB script로 PowerShell을 둘러싸는 방법을 쓸 수는 있단다.  쯧쯧, 이 어찌나 처절한 방법인가.

 

Resolving the problem Because PowerShell opens its own shell, Rational Build Forge cannot directly interact with PowerShell. Future versions of Rational Build Forge may adopt an architectural change that allows interaction with PowerShell, but currently the only method of facilitating this interaction is to wrap the PowerShell command within a Microsoft Visual Basic script. Some users have had success using the site at the following link:
http://blog.sapien.com/index.php/2006/12/20/schedule-hidden-powershell-tasks

이 글은 스프링노트에서 작성되었습니다.

Posted by 아프락사스

그동안 BF 프로젝트를 하다보면, Windows 서버에 재일 먼저 설치하는 것 중 하나가, Cygwin이었다.

많고 많은 Windows의 부족함 중에서, CLI(Command Line Interface)를 이용한 파일 및 시스템 등의 제어였다.

 

BF의 운용은 거짓말 조금 보태서, 95%가 CLI로 해야 하는 것을 감안한다면, Windows란 참으로 거추장 스러운 녀석이었다.

 

Windows는 그 이름에서도 알 수 있듯이(개인적인 의견으로는), GUI로 모든 것을 해결하고자 했었다. 하지만, 시스템 관리자등의 입장에서는 GUI가 불편할 때가 있게 마련이다. 모든걸 보고 할 수 있다는 이야기는 거꾸로 말하면, 아주 작은 일을 하려고 해도 보지 않고는 할 수 없다는 이야기이기 때문.

자동화(automation)으로 가는 데 있어서, 크나큰 장애물임에 틀림없다.

 

이제, 그러한 문제들을 MS가 인정했다는 증거가. PowerShell의 등장이 아닌가 싶다.

아직, 자세히는 둘러보지 못했지만, 접근 방법에 변화를 줬다는 것에 격려의 박수를 주고 싶다.

 

http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx

이 글은 스프링노트에서 작성되었습니다.

Posted by 아프락사스

 몇일간 삽질을 제대로 했다.

 

BF 7.1.1 이미지를 XL에서 받아놓고, Launch Pad로 하거나, Installation 으로 하거나, 계속 Null Pointer에러가 나는 것이었다.

 

결국 PMR을 오픈했는데, 답으로 온것은.. 두개의 이미지(zip)을 한곳에다 압축을 풀고 해보라는 것이다.

 

잘된다!!!! 허걱... zip파일안에 Readme파일을 내가 안 봤던 것이다.

 

전 세계 사람들 중에서 한국인이 가장 매뉴얼을 안 읽는다고 하더니... 제품 지원하는 내가 이런 기초적인 오류를 범하다니.. -.-;

 

 

2009.08.03

설치에는 성공했으나, 빌드 포지 엔진이 제대로 동작하지 않는다. Apahce(콘솔 웹)와 Tomcat(Report)은 정상적으로 동작하고,

한글도 아주 작은 문제를 제외하고는 정상적으로 동작한다.

그런데, 정상적으로 설치된 Agent와의 통신이 당최 동작하지 않는다.

 

2009.08.06

알고 보니, AIX는 Engine을 띄우기 위해서는,  "설치디렉토리/rc/buildforge"를 이용해야 한다.

엔진을 직접적으로 따로 띄워야 하는 것이다. 난 "설치디렉토리/server/start"를 이용해서 Apache와 Tomcat만 따로 띄웠던 것!

Windows버전은 엔진 띄우는 메뉴가 당연히 있고, 이는 결국 Apache와 Tomcat을 띄우는데, 올라올때 보면, Apache와 Tomcat만 올라오는 것으로 보여서, 이제까지 엔진이 따로 뜨고 있었다는 간단한 사실을 망각하고 있었던 것이다.

 

How Stupid I Am!!!!! 

이 글은 스프링노트에서 작성되었습니다.

Posted by 아프락사스

 이 나왔다.  이전 버전들을 모두 포함하고 있다.

 

자세한 설치 관련 내용은 다음의 링크를

http://www-01.ibm.com/support/docview.wss?rs=3352&context=SSDV2W&context=SSCZQKL&context=SSSTY3&dc=D400&uid=swg24023138&loc=en_US&cs=UTF-8&lang=en

 

Unix나 Linux에서 GUI 환경으로 설치하기 어려울 때,

      b. For a silent install, open a command prompt to the extracted directory.  For example, C:\temp.  Run the command:
        Windows: installc --launcher.ini silent-install.ini
        Linux and UNIX systems: ./install --launcher.ini silent-install.ini

 

 

이렇게 인스톨된 IM으로 설치하려는 제품 자체도 silent 인스톨 하고 싶을 때.

• Record a response file and install the product:
IBMIM -record <response file path and name> -log <log file path and name>
• Record a response file without installing the product:
IBMIM -record <response file path and name> -log <log file path and name> -skipInstall <agentDataLocation>

 를 이용하여 record파일(xml)을 만들어 낸다.

 

이 record파일을 이용하여, 다음의 명령으로 실제로 설치를 할 수 있다.

IBMIM --launcher.ini silent-install.ini -input <response file path and name> -log <log file path and name>

이 글은 스프링노트에서 작성되었습니다.

Posted by 아프락사스

XWindows 연결 오류

2009/07/28 19:52

 XWindows로 연결할 때, 다음과 같은 메시지가 나올 수 있다.

 

Xlib: connection to ":0.0" refused by server
Xlib: Client is not authorized to connect to Server

 

이는 해당 호스트가 접속되도록 등록이 안된경우가 많다.

xhost +   

  --> 모든 호스트에 대한 접근 허가

xhost "host명"

  --> 특정 호스트에 대한 접근 허가.

이 글은 스프링노트에서 작성되었습니다.

Posted by 아프락사스

BLOG main image

공지사항

카테고리

분류 전체보기 (155)
Architect이야기 (1)
Rational Products (94)
Patterns (0)
JEE Technologies (3)
Methodology (0)
Apache Project (0)
Open Project (4)
Knowhow (52)
Etc (0)