#!/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>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 1130 | 18년 전 | 2467 | ||
| 1129 | 18년 전 | 2449 | ||
| 1128 | 18년 전 | 2320 | ||
| 1127 | 18년 전 | 2558 | ||
| 1126 |
|
18년 전 | 3855 | |
| 1125 | 18년 전 | 3660 | ||
| 1124 |
|
18년 전 | 2093 | |
| 1123 | 18년 전 | 2028 | ||
| 1122 | 18년 전 | 1570 | ||
| 1121 | 18년 전 | 3898 | ||
| 1120 | 18년 전 | 5893 | ||
| 1119 | 18년 전 | 6988 | ||
| 1118 | 18년 전 | 2470 | ||
| 1117 |
BEST79
|
18년 전 | 2723 | |
| 1116 | 18년 전 | 4184 | ||
| 1115 | 18년 전 | 2178 | ||
| 1114 |
|
18년 전 | 3633 | |
| 1113 | 18년 전 | 2875 | ||
| 1112 | 18년 전 | 2734 | ||
| 1111 | 18년 전 | 2198 | ||
| 1110 | 18년 전 | 2471 | ||
| 1109 | 18년 전 | 2606 | ||
| 1108 | 18년 전 | 3091 | ||
| 1107 | 18년 전 | 3734 | ||
| 1106 | 18년 전 | 3268 | ||
| 1105 | 18년 전 | 2783 | ||
| 1104 |
|
18년 전 | 2272 | |
| 1103 | 18년 전 | 2942 | ||
| 1102 | 18년 전 | 3025 | ||
| 1101 | 18년 전 | 2537 | ||
| 1100 | 18년 전 | 2297 | ||
| 1099 | 18년 전 | 3324 | ||
| 1098 | 18년 전 | 4846 | ||
| 1097 | 18년 전 | 5083 | ||
| 1096 | 18년 전 | 2299 | ||
| 1095 | 18년 전 | 2186 | ||
| 1094 | 18년 전 | 5002 | ||
| 1093 | 18년 전 | 8965 | ||
| 1092 | 18년 전 | 2040 | ||
| 1091 |
DeepnBlue
|
18년 전 | 4919 | |
| 1090 |
|
18년 전 | 4369 | |
| 1089 |
도날드주주
|
18년 전 | 2609 | |
| 1088 |
|
18년 전 | 4959 | |
| 1087 | 18년 전 | 2789 | ||
| 1086 | 18년 전 | 3672 | ||
| 1085 | 18년 전 | 2619 | ||
| 1084 | 18년 전 | 3433 | ||
| 1083 | 18년 전 | 1941 | ||
| 1082 | 18년 전 | 5373 | ||
| 1081 | 18년 전 | 1694 | ||
| 1080 | 18년 전 | 6051 | ||
| 1079 |
|
18년 전 | 2880 | |
| 1078 | 18년 전 | 6038 | ||
| 1077 |
|
18년 전 | 6839 | |
| 1076 | 18년 전 | 3725 | ||
| 1075 | 18년 전 | 2207 | ||
| 1074 |
hwatta
|
18년 전 | 2097 | |
| 1073 | 18년 전 | 6899 | ||
| 1072 | 18년 전 | 2397 | ||
| 1071 | 18년 전 | 3955 | ||
| 1070 |
|
18년 전 | 5344 | |
| 1069 | 18년 전 | 2691 | ||
| 1068 | 18년 전 | 1751 | ||
| 1067 | 18년 전 | 1583 | ||
| 1066 | 18년 전 | 1532 | ||
| 1065 | 18년 전 | 1809 | ||
| 1064 | 18년 전 | 1802 | ||
| 1063 | 18년 전 | 1781 | ||
| 1062 | 18년 전 | 1715 | ||
| 1061 | 18년 전 | 2509 | ||
| 1060 | 18년 전 | 2312 | ||
| 1059 | 18년 전 | 3465 | ||
| 1058 | 18년 전 | 2594 | ||
| 1057 | 18년 전 | 2575 | ||
| 1056 | 18년 전 | 3410 | ||
| 1055 | 18년 전 | 4626 | ||
| 1054 | 18년 전 | 2963 | ||
| 1053 | 18년 전 | 2810 | ||
| 1052 | 18년 전 | 3350 | ||
| 1051 | 18년 전 | 6278 | ||
| 1050 | 18년 전 | 2180 | ||
| 1049 | 18년 전 | 1991 | ||
| 1048 | 18년 전 | 1947 | ||
| 1047 | 18년 전 | 2008 | ||
| 1046 | 18년 전 | 3195 | ||
| 1045 | 18년 전 | 2263 | ||
| 1044 | 18년 전 | 1955 | ||
| 1043 | 18년 전 | 1620 | ||
| 1042 | 18년 전 | 2079 | ||
| 1041 | 18년 전 | 3366 | ||
| 1040 | 18년 전 | 3232 | ||
| 1039 | 18년 전 | 1921 | ||
| 1038 | 18년 전 | 1496 | ||
| 1037 | 18년 전 | 3190 | ||
| 1036 | 18년 전 | 2060 | ||
| 1035 | 18년 전 | 1614 | ||
| 1034 | 18년 전 | 2837 | ||
| 1033 | 18년 전 | 1972 | ||
| 1032 | 18년 전 | 1845 | ||
| 1031 | 18년 전 | 1819 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기