#!/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년 전 | 430 | ||
| 7929 | 9년 전 | 358 | ||
| 7928 | 9년 전 | 447 | ||
| 7927 | 9년 전 | 360 | ||
| 7926 | 9년 전 | 675 | ||
| 7925 | 9년 전 | 383 | ||
| 7924 | 9년 전 | 370 | ||
| 7923 | 9년 전 | 365 | ||
| 7922 | 9년 전 | 398 | ||
| 7921 | 9년 전 | 415 | ||
| 7920 | 9년 전 | 334 | ||
| 7919 | 9년 전 | 344 | ||
| 7918 | 9년 전 | 498 | ||
| 7917 | 9년 전 | 351 | ||
| 7916 | 9년 전 | 429 | ||
| 7915 | 9년 전 | 430 | ||
| 7914 | 9년 전 | 440 | ||
| 7913 | 9년 전 | 610 | ||
| 7912 | 9년 전 | 449 | ||
| 7911 | 9년 전 | 383 | ||
| 7910 | 9년 전 | 428 | ||
| 7909 | 9년 전 | 534 | ||
| 7908 | 9년 전 | 459 | ||
| 7907 | 9년 전 | 403 | ||
| 7906 | 9년 전 | 422 | ||
| 7905 | 9년 전 | 396 | ||
| 7904 | 9년 전 | 381 | ||
| 7903 | 9년 전 | 376 | ||
| 7902 | 9년 전 | 578 | ||
| 7901 |
|
9년 전 | 758 | |
| 7900 | 9년 전 | 619 | ||
| 7899 | 9년 전 | 409 | ||
| 7898 | 9년 전 | 415 | ||
| 7897 | 9년 전 | 370 | ||
| 7896 | 9년 전 | 380 | ||
| 7895 | 9년 전 | 492 | ||
| 7894 | 9년 전 | 414 | ||
| 7893 | 9년 전 | 380 | ||
| 7892 | 9년 전 | 423 | ||
| 7891 | 9년 전 | 788 | ||
| 7890 | 9년 전 | 1217 | ||
| 7889 | 9년 전 | 755 | ||
| 7888 |
limsy1987
|
9년 전 | 565 | |
| 7887 | 9년 전 | 588 | ||
| 7886 | 9년 전 | 479 | ||
| 7885 | 9년 전 | 434 | ||
| 7884 | 9년 전 | 435 | ||
| 7883 | 9년 전 | 440 | ||
| 7882 | 9년 전 | 494 | ||
| 7881 | 9년 전 | 466 | ||
| 7880 | 9년 전 | 600 | ||
| 7879 | 9년 전 | 491 | ||
| 7878 | 9년 전 | 1249 | ||
| 7877 | 9년 전 | 783 | ||
| 7876 | 9년 전 | 517 | ||
| 7875 | 9년 전 | 591 | ||
| 7874 |
|
9년 전 | 823 | |
| 7873 | 9년 전 | 534 | ||
| 7872 | 9년 전 | 699 | ||
| 7871 | 9년 전 | 508 | ||
| 7870 | 9년 전 | 632 | ||
| 7869 | 9년 전 | 449 | ||
| 7868 | 9년 전 | 478 | ||
| 7867 | 9년 전 | 463 | ||
| 7866 | 9년 전 | 524 | ||
| 7865 | 9년 전 | 473 | ||
| 7864 | 9년 전 | 538 | ||
| 7863 | 9년 전 | 536 | ||
| 7862 | 9년 전 | 488 | ||
| 7861 | 9년 전 | 670 | ||
| 7860 | 9년 전 | 650 | ||
| 7859 | 9년 전 | 433 | ||
| 7858 | 9년 전 | 726 | ||
| 7857 | 9년 전 | 1110 | ||
| 7856 | 9년 전 | 550 | ||
| 7855 | 9년 전 | 776 | ||
| 7854 | 9년 전 | 740 | ||
| 7853 | 9년 전 | 610 | ||
| 7852 | 9년 전 | 545 | ||
| 7851 | 9년 전 | 532 | ||
| 7850 | 9년 전 | 611 | ||
| 7849 | 9년 전 | 379 | ||
| 7848 | 9년 전 | 444 | ||
| 7847 | 9년 전 | 686 | ||
| 7846 | 9년 전 | 479 | ||
| 7845 | 9년 전 | 449 | ||
| 7844 | 9년 전 | 418 | ||
| 7843 | 9년 전 | 448 | ||
| 7842 | 9년 전 | 427 | ||
| 7841 | 9년 전 | 408 | ||
| 7840 | 9년 전 | 423 | ||
| 7839 | 9년 전 | 456 | ||
| 7838 | 9년 전 | 530 | ||
| 7837 | 9년 전 | 375 | ||
| 7836 | 9년 전 | 425 | ||
| 7835 | 9년 전 | 497 | ||
| 7834 |
|
9년 전 | 1207 | |
| 7833 | 9년 전 | 460 | ||
| 7832 | 9년 전 | 444 | ||
| 7831 | 9년 전 | 594 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기