#!/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>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7930 | 9년 전 | 423 | ||
| 7929 | 9년 전 | 352 | ||
| 7928 | 9년 전 | 439 | ||
| 7927 | 9년 전 | 357 | ||
| 7926 | 9년 전 | 674 | ||
| 7925 | 9년 전 | 380 | ||
| 7924 | 9년 전 | 363 | ||
| 7923 | 9년 전 | 359 | ||
| 7922 | 9년 전 | 394 | ||
| 7921 | 9년 전 | 413 | ||
| 7920 | 9년 전 | 329 | ||
| 7919 | 9년 전 | 342 | ||
| 7918 | 9년 전 | 498 | ||
| 7917 | 9년 전 | 350 | ||
| 7916 | 9년 전 | 422 | ||
| 7915 | 9년 전 | 427 | ||
| 7914 | 9년 전 | 435 | ||
| 7913 | 9년 전 | 601 | ||
| 7912 | 9년 전 | 444 | ||
| 7911 | 9년 전 | 380 | ||
| 7910 | 9년 전 | 422 | ||
| 7909 | 9년 전 | 529 | ||
| 7908 | 9년 전 | 452 | ||
| 7907 | 9년 전 | 394 | ||
| 7906 | 9년 전 | 412 | ||
| 7905 | 9년 전 | 390 | ||
| 7904 | 9년 전 | 375 | ||
| 7903 | 9년 전 | 368 | ||
| 7902 | 9년 전 | 572 | ||
| 7901 |
|
9년 전 | 754 | |
| 7900 | 9년 전 | 614 | ||
| 7899 | 9년 전 | 407 | ||
| 7898 | 9년 전 | 408 | ||
| 7897 | 9년 전 | 365 | ||
| 7896 | 9년 전 | 376 | ||
| 7895 | 9년 전 | 487 | ||
| 7894 | 9년 전 | 411 | ||
| 7893 | 9년 전 | 367 | ||
| 7892 | 9년 전 | 414 | ||
| 7891 | 9년 전 | 784 | ||
| 7890 | 9년 전 | 1210 | ||
| 7889 | 9년 전 | 755 | ||
| 7888 |
limsy1987
|
9년 전 | 561 | |
| 7887 | 9년 전 | 582 | ||
| 7886 | 9년 전 | 471 | ||
| 7885 | 9년 전 | 429 | ||
| 7884 | 9년 전 | 431 | ||
| 7883 | 9년 전 | 431 | ||
| 7882 | 9년 전 | 482 | ||
| 7881 | 9년 전 | 461 | ||
| 7880 | 9년 전 | 597 | ||
| 7879 | 9년 전 | 482 | ||
| 7878 | 9년 전 | 1242 | ||
| 7877 | 9년 전 | 772 | ||
| 7876 | 9년 전 | 507 | ||
| 7875 | 9년 전 | 581 | ||
| 7874 |
|
9년 전 | 821 | |
| 7873 | 9년 전 | 532 | ||
| 7872 | 9년 전 | 693 | ||
| 7871 | 9년 전 | 498 | ||
| 7870 | 9년 전 | 628 | ||
| 7869 | 9년 전 | 446 | ||
| 7868 | 9년 전 | 474 | ||
| 7867 | 9년 전 | 458 | ||
| 7866 | 9년 전 | 518 | ||
| 7865 | 9년 전 | 469 | ||
| 7864 | 9년 전 | 531 | ||
| 7863 | 9년 전 | 529 | ||
| 7862 | 9년 전 | 482 | ||
| 7861 | 9년 전 | 664 | ||
| 7860 | 9년 전 | 639 | ||
| 7859 | 9년 전 | 430 | ||
| 7858 | 9년 전 | 719 | ||
| 7857 | 9년 전 | 1099 | ||
| 7856 | 9년 전 | 545 | ||
| 7855 | 9년 전 | 773 | ||
| 7854 | 9년 전 | 738 | ||
| 7853 | 9년 전 | 599 | ||
| 7852 | 9년 전 | 532 | ||
| 7851 | 9년 전 | 530 | ||
| 7850 | 9년 전 | 605 | ||
| 7849 | 9년 전 | 374 | ||
| 7848 | 9년 전 | 434 | ||
| 7847 | 9년 전 | 677 | ||
| 7846 | 9년 전 | 470 | ||
| 7845 | 9년 전 | 442 | ||
| 7844 | 9년 전 | 412 | ||
| 7843 | 9년 전 | 436 | ||
| 7842 | 9년 전 | 420 | ||
| 7841 | 9년 전 | 402 | ||
| 7840 | 9년 전 | 418 | ||
| 7839 | 9년 전 | 451 | ||
| 7838 | 9년 전 | 526 | ||
| 7837 | 9년 전 | 373 | ||
| 7836 | 9년 전 | 417 | ||
| 7835 | 9년 전 | 492 | ||
| 7834 |
|
9년 전 | 1204 | |
| 7833 | 9년 전 | 453 | ||
| 7832 | 9년 전 | 437 | ||
| 7831 | 9년 전 | 584 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기