PS3 prompt 설정

서버관리 2012.11.28 16:49

  • PS3 설정하지 않았을 때
    root@www ~> cat ps3.sh 
    select i in mon tue wed exit
    do
         case $i in
              mon) echo "Monday";;
              tue) echo "Tuesday";;
              wed) echo "Wednesday";;
              exit) exit;;
         esac
    done

    root@www ~> chmod 700 ps3.sh 
    root@www ~> ./ps3.sh 
    1) mon
    2) tue
    3) wed
    4) exit
    #? 1
    Monday
    #? 4
  • PS3 를 설정했을 때
    root@www ~> cat ps3.sh 
    PS3="Select a day (1-4) : "
    select i in mon tue wed exit
    do
         case $i in
              mon) echo "Monday";;
              tue) echo "Tuesday";;
              wed) echo "Wednesday";;
              exit) exit;;
         esac
    done

    root@www ~> ./ps3.sh 
    1) mon
    2) tue
    3) wed
    4) exit
    Select a day (1-4) : 2
    Tuesday
    Select a day (1-4) : 4
  • command prompt 를 보기 좋게 출력해 준다.

저작자 표시 비영리 동일 조건 변경 허락
신고
크리에이티브 커먼즈 라이선스
Creative Commons License

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret


  1. Ensure that your Linux virtual machine is powered on.
  2. If you are running a GUI interface, open a command shell.

    Note: Log in as a root user, or use the sudo command to complete each of these steps.
  3. Click VM in the virtual machine menu, then click Guest > Install/Upgrade VMware Tools and click OK.
  4. To create a mount point, run:

    mkdir /mnt/cdrom
  5. To mount the CDROM, run:

    mount /dev/cdrom /mnt/cdrom
  6. To copy the Compiler gzip tar file to a temporary local directory, run:

    cp /mnt/cdrom/VMwareTools-<version>.tar.gz /tmp/

    Where <version> is the VMware Tools package version.
  7. To change to the tmp directory and extract the contents of the tar file into a new directory called vmware-tools-distrib, run:
    • cd /tmp
    • tar -zxvf VMwareTools-<version>.tar.gz
  8. To change directory to vmware-tools-distrib and run the vmware-install.pl PERL script to install VMware Tools, run:
    • cd vmware-tools-distrib
    • ./vmware-install.pl

      Notes:
      • Follow the screen prompts to install the VMware Tools. Options in square brackets are default choices and can be selected by pressing Enter.
      • To compile VMware Tools successfully, you need gcc Compiler and Linux Kernel sources provided by your Linux distribution. Consult your Linux distribution documentation for details on how to install these packages.
      • It is normal for the console screen to go blank for a short time during the installation when the display size changes.
      • Some warnings or errors are normal, like when a files does not exist.
      • Depending on the Linux distribution, your network service might restart after installation. VMware recommends that you invoke this command from the console and not remotely.
  9. If you are running a GUI interface, restart your X Window session for any mouse or graphics changes to take effect.
  10. To start VMware Tools running in the background during an X Window session, run:

    /usr/bin/vmware-toolbox &
  11. Depending on your environment you may need to unmount the CDROM. To unmount the CDROM, run:

    umount /mnt/cdrom
  12. Depending on your environment, you may need to manually end the VMware Tools installation. To end the VMware Tools install, click VM in the virtual machine menu, then click Guest > End VMware Tools Install.

 

저작자 표시 비영리 동일 조건 변경 허락
신고
크리에이티브 커먼즈 라이선스
Creative Commons License

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret
Argument list too long

해당 디렉토리로 가서 아래 스크립트 실행

for file in $(ls)
do
    rm -fv $file
done


안써먹으니 이 간단한것도 기억에서 잊혀진다.


# find ./ -name "*.log" -print0 
./1.log./2.log

 

# find ./ -name "*.log" -print0 | xargs -0 rm -f
# ls

다 지워 졌음.

 

 

find 옵션

-print0
True; print the full file name on the standard output, followed by a null
character (instead of the newline character that '-print' uses). This
allows file names that contain newlines or other types of white space to be
correctly interpreted by programs that process the find output. This option
corresponds to the '-0' option of xargs.

 

 

xargs 옵션

--null, -0

Input items are terminated by a null character instead of by whitespace, and
the quotes and backslash are not special (every character is taken liter-
ally). Disables the end of file string, which is treated like any other
argument. Useful when input items might contain white space, quote marks,
or backslashes. The GNU find -print0 option produces input suitable for
this mode.

신고
크리에이티브 커먼즈 라이선스
Creative Commons License

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret