#!/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>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 130 | 20년 전 | 3999 | ||
| 129 | 20년 전 | 2936 | ||
| 128 | 20년 전 | 3670 | ||
| 127 | 20년 전 | 3502 | ||
| 126 | 20년 전 | 3758 | ||
| 125 | 20년 전 | 8588 | ||
| 124 | 20년 전 | 2601 | ||
| 123 | 20년 전 | 3744 | ||
| 122 | 20년 전 | 3205 | ||
| 121 | 20년 전 | 2609 | ||
| 120 | 20년 전 | 2669 | ||
| 119 | 20년 전 | 2581 | ||
| 118 | 20년 전 | 2859 | ||
| 117 |
|
20년 전 | 3055 | |
| 116 | 20년 전 | 5308 | ||
| 115 | 20년 전 | 3919 | ||
| 114 | 20년 전 | 4969 | ||
| 113 | 20년 전 | 6209 | ||
| 112 | 20년 전 | 7322 | ||
| 111 | 20년 전 | 18430 | ||
| 110 | 20년 전 | 6873 | ||
| 109 | 20년 전 | 2877 | ||
| 108 | 20년 전 | 4137 | ||
| 107 |
prosper
|
20년 전 | 2497 | |
| 106 |
prosper
|
20년 전 | 4315 | |
| 105 |
아우겐나이스
|
20년 전 | 2913 | |
| 104 | 20년 전 | 2257 | ||
| 103 | 20년 전 | 2477 | ||
| 102 | 20년 전 | 2256 | ||
| 101 | 20년 전 | 2573 | ||
| 100 | 20년 전 | 1744 | ||
| 99 | 20년 전 | 1564 | ||
| 98 | 20년 전 | 1617 | ||
| 97 | 20년 전 | 2128 | ||
| 96 | 20년 전 | 1871 | ||
| 95 | 20년 전 | 2372 | ||
| 94 | 20년 전 | 3564 | ||
| 93 | 20년 전 | 1558 | ||
| 92 | 20년 전 | 1756 | ||
| 91 | 20년 전 | 3180 | ||
| 90 | 20년 전 | 2339 | ||
| 89 | 20년 전 | 3169 | ||
| 88 | 20년 전 | 2870 | ||
| 87 | 20년 전 | 3294 | ||
| 86 | 20년 전 | 5132 | ||
| 85 | 20년 전 | 2518 | ||
| 84 | 20년 전 | 4824 | ||
| 83 | 20년 전 | 2501 | ||
| 82 | 20년 전 | 3119 | ||
| 81 | 20년 전 | 7624 | ||
| 80 | 20년 전 | 3822 | ||
| 79 | 20년 전 | 3206 | ||
| 78 | 20년 전 | 4694 | ||
| 77 | 20년 전 | 2897 | ||
| 76 | 20년 전 | 6216 | ||
| 75 | 20년 전 | 4470 | ||
| 74 | 20년 전 | 5781 | ||
| 73 | 20년 전 | 3625 | ||
| 72 | 20년 전 | 5967 | ||
| 71 | 20년 전 | 3117 | ||
| 70 | 20년 전 | 2838 | ||
| 69 | 20년 전 | 2640 | ||
| 68 | 20년 전 | 2445 | ||
| 67 | 20년 전 | 2653 | ||
| 66 | 20년 전 | 2669 | ||
| 65 | 20년 전 | 3787 | ||
| 64 | 20년 전 | 2825 | ||
| 63 | 20년 전 | 2455 | ||
| 62 | 20년 전 | 2264 | ||
| 61 | 20년 전 | 3070 | ||
| 60 | 20년 전 | 3134 | ||
| 59 | 20년 전 | 2515 | ||
| 58 | 20년 전 | 2589 | ||
| 57 | 20년 전 | 2967 | ||
| 56 | 20년 전 | 2317 | ||
| 55 | 20년 전 | 2761 | ||
| 54 | 20년 전 | 2128 | ||
| 53 | 20년 전 | 2348 | ||
| 52 | 20년 전 | 2699 | ||
| 51 |
prosper
|
21년 전 | 2351 | |
| 50 |
prosper
|
21년 전 | 2170 | |
| 49 | 21년 전 | 2178 | ||
| 48 | 21년 전 | 2340 | ||
| 47 | 21년 전 | 1932 | ||
| 46 | 21년 전 | 1928 | ||
| 45 | 21년 전 | 2133 | ||
| 44 | 21년 전 | 2360 | ||
| 43 | 21년 전 | 4573 | ||
| 42 |
prosper
|
21년 전 | 2714 | |
| 41 |
prosper
|
21년 전 | 2114 | |
| 40 | 21년 전 | 2178 | ||
| 39 | 21년 전 | 2145 | ||
| 38 | 21년 전 | 2418 | ||
| 37 | 21년 전 | 2568 | ||
| 36 | 21년 전 | 1770 | ||
| 35 | 21년 전 | 4070 | ||
| 34 | 21년 전 | 3850 | ||
| 33 | 21년 전 | 2990 | ||
| 32 |
prosper
|
21년 전 | 2903 | |
| 31 | 21년 전 | 5277 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기