#!/bin/bash
############# start ##################
# copyright(c)조훈현
#시나리오 : 퇴근시간이 다되었고
#애인과 퇴근 1시간후에 약속이 되어있다.
#그런데 긴급한 상황으로 system에 1000명이 넘는 사용자의
#계정에 특정파일을 패치 해야한다.
#수동으로 한다면 4시간으로도 해결은 불가능하다.
#그러나 간단한 shell 프로그래밍은 애인과의 저녁시간을
#확보시켜준다.
#주의 : 단 사용자의 홈디렉토리가 한디렉토리의
#subdiretory 이어만 한다.
####################################
echo " input target file or directory: "
read target
echo " input destination directory : "
read destination
for dir in `ls -l $destination | grep '\<d' | cut -c 57-100`
do
cp -r $target /$destination/$dir
done
echo "complete copy!!!"
exit 0
############# E N D #############
만약 home디렉토리가 /home의 subdiretory가 아니라면
----------------------------------------------
for dir in `ls -l $destination | grep '\<d' | cut -c 57-100`
do
cp -r $target /$destination/$dir
done
----------------------------------------------
를 아래의
------------------------------------------------------------
for dir in `tail +$(cut -f 1,3 -d: /etc/passwd | grep -n 500 | cut -f 1 -d:) /etc/passwd | cut -f 6 -d:`
do
cp -r $target $dir
done
------------------------------------------------------------
로 치환한다
주의!! 이프로그램 실행으로 일어나는 어떠한 책임도 저작권자는 책임이 없음을 밝힙니다.
학습용으로 사용하시길 권장합니다.~~^^<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:32:05 Linux에서 이동 됨]</div>
############# start ##################
# copyright(c)조훈현
#시나리오 : 퇴근시간이 다되었고
#애인과 퇴근 1시간후에 약속이 되어있다.
#그런데 긴급한 상황으로 system에 1000명이 넘는 사용자의
#계정에 특정파일을 패치 해야한다.
#수동으로 한다면 4시간으로도 해결은 불가능하다.
#그러나 간단한 shell 프로그래밍은 애인과의 저녁시간을
#확보시켜준다.
#주의 : 단 사용자의 홈디렉토리가 한디렉토리의
#subdiretory 이어만 한다.
####################################
echo " input target file or directory: "
read target
echo " input destination directory : "
read destination
for dir in `ls -l $destination | grep '\<d' | cut -c 57-100`
do
cp -r $target /$destination/$dir
done
echo "complete copy!!!"
exit 0
############# E N D #############
만약 home디렉토리가 /home의 subdiretory가 아니라면
----------------------------------------------
for dir in `ls -l $destination | grep '\<d' | cut -c 57-100`
do
cp -r $target /$destination/$dir
done
----------------------------------------------
를 아래의
------------------------------------------------------------
for dir in `tail +$(cut -f 1,3 -d: /etc/passwd | grep -n 500 | cut -f 1 -d:) /etc/passwd | cut -f 6 -d:`
do
cp -r $target $dir
done
------------------------------------------------------------
로 치환한다
주의!! 이프로그램 실행으로 일어나는 어떠한 책임도 저작권자는 책임이 없음을 밝힙니다.
학습용으로 사용하시길 권장합니다.~~^^<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:32:05 Linux에서 이동 됨]</div>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 8130 | 9년 전 | 500 | ||
| 8129 |
|
9년 전 | 647 | |
| 8128 | 9년 전 | 515 | ||
| 8127 |
|
9년 전 | 572 | |
| 8126 | 9년 전 | 502 | ||
| 8125 | 9년 전 | 761 | ||
| 8124 |
|
9년 전 | 508 | |
| 8123 | 9년 전 | 491 | ||
| 8122 | 9년 전 | 429 | ||
| 8121 | 9년 전 | 526 | ||
| 8120 | 9년 전 | 457 | ||
| 8119 | 9년 전 | 543 | ||
| 8118 |
|
9년 전 | 626 | |
| 8117 |
|
9년 전 | 397 | |
| 8116 |
PASKRAN
|
9년 전 | 463 | |
| 8115 | 9년 전 | 453 | ||
| 8114 |
kiplayer
|
9년 전 | 592 | |
| 8113 | 9년 전 | 433 | ||
| 8112 |
|
9년 전 | 552 | |
| 8111 | 9년 전 | 405 | ||
| 8110 | 9년 전 | 439 | ||
| 8109 | 9년 전 | 358 | ||
| 8108 |
|
9년 전 | 537 | |
| 8107 |
|
9년 전 | 435 | |
| 8106 |
|
9년 전 | 425 | |
| 8105 | 9년 전 | 471 | ||
| 8104 |
|
9년 전 | 426 | |
| 8103 |
|
9년 전 | 422 | |
| 8102 |
|
9년 전 | 388 | |
| 8101 |
snshero
|
9년 전 | 774 | |
| 8100 | 9년 전 | 832 | ||
| 8099 | 9년 전 | 800 | ||
| 8098 | 9년 전 | 708 | ||
| 8097 | 9년 전 | 505 | ||
| 8096 | 9년 전 | 705 | ||
| 8095 | 9년 전 | 833 | ||
| 8094 | 9년 전 | 507 | ||
| 8093 | 9년 전 | 791 | ||
| 8092 | 9년 전 | 752 | ||
| 8091 | 9년 전 | 1137 | ||
| 8090 | 9년 전 | 759 | ||
| 8089 | 9년 전 | 964 | ||
| 8088 | 9년 전 | 632 | ||
| 8087 | 9년 전 | 744 | ||
| 8086 | 9년 전 | 513 | ||
| 8085 | 9년 전 | 481 | ||
| 8084 | 9년 전 | 607 | ||
| 8083 | 9년 전 | 579 | ||
| 8082 | 9년 전 | 750 | ||
| 8081 | 9년 전 | 464 | ||
| 8080 | 9년 전 | 561 | ||
| 8079 | 9년 전 | 512 | ||
| 8078 | 9년 전 | 440 | ||
| 8077 | 9년 전 | 520 | ||
| 8076 | 9년 전 | 401 | ||
| 8075 | 9년 전 | 429 | ||
| 8074 | 9년 전 | 386 | ||
| 8073 | 9년 전 | 442 | ||
| 8072 | 9년 전 | 432 | ||
| 8071 |
o1o111
|
9년 전 | 887 | |
| 8070 | 9년 전 | 395 | ||
| 8069 | 9년 전 | 329 | ||
| 8068 | 9년 전 | 579 | ||
| 8067 | 9년 전 | 387 | ||
| 8066 | 9년 전 | 421 | ||
| 8065 | 9년 전 | 375 | ||
| 8064 | 9년 전 | 355 | ||
| 8063 | 9년 전 | 329 | ||
| 8062 | 9년 전 | 299 | ||
| 8061 | 9년 전 | 346 | ||
| 8060 | 9년 전 | 380 | ||
| 8059 | 9년 전 | 312 | ||
| 8058 | 9년 전 | 248 | ||
| 8057 | 9년 전 | 382 | ||
| 8056 | 9년 전 | 301 | ||
| 8055 | 9년 전 | 339 | ||
| 8054 | 9년 전 | 355 | ||
| 8053 | 9년 전 | 406 | ||
| 8052 | 9년 전 | 285 | ||
| 8051 | 9년 전 | 323 | ||
| 8050 | 9년 전 | 384 | ||
| 8049 | 9년 전 | 316 | ||
| 8048 | 9년 전 | 429 | ||
| 8047 | 9년 전 | 349 | ||
| 8046 | 9년 전 | 293 | ||
| 8045 | 9년 전 | 248 | ||
| 8044 | 9년 전 | 341 | ||
| 8043 | 9년 전 | 278 | ||
| 8042 | 9년 전 | 284 | ||
| 8041 | 9년 전 | 332 | ||
| 8040 | 9년 전 | 260 | ||
| 8039 | 9년 전 | 313 | ||
| 8038 | 9년 전 | 263 | ||
| 8037 | 9년 전 | 393 | ||
| 8036 | 9년 전 | 471 | ||
| 8035 | 9년 전 | 421 | ||
| 8034 | 9년 전 | 383 | ||
| 8033 | 9년 전 | 342 | ||
| 8032 | 9년 전 | 422 | ||
| 8031 | 9년 전 | 337 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기