#!/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년 전 | 384 | ||
| 7929 | 9년 전 | 282 | ||
| 7928 | 9년 전 | 388 | ||
| 7927 | 9년 전 | 310 | ||
| 7926 | 9년 전 | 652 | ||
| 7925 | 9년 전 | 326 | ||
| 7924 | 9년 전 | 309 | ||
| 7923 | 9년 전 | 329 | ||
| 7922 | 9년 전 | 349 | ||
| 7921 | 9년 전 | 382 | ||
| 7920 | 9년 전 | 303 | ||
| 7919 | 9년 전 | 321 | ||
| 7918 | 9년 전 | 479 | ||
| 7917 | 9년 전 | 321 | ||
| 7916 | 9년 전 | 389 | ||
| 7915 | 9년 전 | 383 | ||
| 7914 | 9년 전 | 393 | ||
| 7913 | 9년 전 | 523 | ||
| 7912 | 9년 전 | 390 | ||
| 7911 | 9년 전 | 336 | ||
| 7910 | 9년 전 | 376 | ||
| 7909 | 9년 전 | 479 | ||
| 7908 | 9년 전 | 384 | ||
| 7907 | 9년 전 | 338 | ||
| 7906 | 9년 전 | 355 | ||
| 7905 | 9년 전 | 340 | ||
| 7904 | 9년 전 | 313 | ||
| 7903 | 9년 전 | 316 | ||
| 7902 | 9년 전 | 527 | ||
| 7901 |
|
9년 전 | 722 | |
| 7900 | 9년 전 | 554 | ||
| 7899 | 9년 전 | 356 | ||
| 7898 | 9년 전 | 355 | ||
| 7897 | 9년 전 | 309 | ||
| 7896 | 9년 전 | 338 | ||
| 7895 | 9년 전 | 439 | ||
| 7894 | 9년 전 | 361 | ||
| 7893 | 9년 전 | 301 | ||
| 7892 | 9년 전 | 355 | ||
| 7891 | 9년 전 | 732 | ||
| 7890 | 9년 전 | 1182 | ||
| 7889 | 9년 전 | 738 | ||
| 7888 |
limsy1987
|
9년 전 | 532 | |
| 7887 | 9년 전 | 520 | ||
| 7886 | 9년 전 | 408 | ||
| 7885 | 9년 전 | 380 | ||
| 7884 | 9년 전 | 382 | ||
| 7883 | 9년 전 | 374 | ||
| 7882 | 9년 전 | 393 | ||
| 7881 | 9년 전 | 409 | ||
| 7880 | 9년 전 | 534 | ||
| 7879 | 9년 전 | 430 | ||
| 7878 | 9년 전 | 1180 | ||
| 7877 | 9년 전 | 726 | ||
| 7876 | 9년 전 | 452 | ||
| 7875 | 9년 전 | 531 | ||
| 7874 |
|
9년 전 | 789 | |
| 7873 | 9년 전 | 489 | ||
| 7872 | 9년 전 | 640 | ||
| 7871 | 9년 전 | 457 | ||
| 7870 | 9년 전 | 587 | ||
| 7869 | 9년 전 | 400 | ||
| 7868 | 9년 전 | 403 | ||
| 7867 | 9년 전 | 398 | ||
| 7866 | 9년 전 | 464 | ||
| 7865 | 9년 전 | 418 | ||
| 7864 | 9년 전 | 480 | ||
| 7863 | 9년 전 | 475 | ||
| 7862 | 9년 전 | 444 | ||
| 7861 | 9년 전 | 606 | ||
| 7860 | 9년 전 | 602 | ||
| 7859 | 9년 전 | 381 | ||
| 7858 | 9년 전 | 681 | ||
| 7857 | 9년 전 | 1039 | ||
| 7856 | 9년 전 | 493 | ||
| 7855 | 9년 전 | 719 | ||
| 7854 | 9년 전 | 706 | ||
| 7853 | 9년 전 | 560 | ||
| 7852 | 9년 전 | 479 | ||
| 7851 | 9년 전 | 465 | ||
| 7850 | 9년 전 | 563 | ||
| 7849 | 9년 전 | 330 | ||
| 7848 | 9년 전 | 382 | ||
| 7847 | 9년 전 | 605 | ||
| 7846 | 9년 전 | 430 | ||
| 7845 | 9년 전 | 384 | ||
| 7844 | 9년 전 | 373 | ||
| 7843 | 9년 전 | 386 | ||
| 7842 | 9년 전 | 375 | ||
| 7841 | 9년 전 | 363 | ||
| 7840 | 9년 전 | 370 | ||
| 7839 | 9년 전 | 411 | ||
| 7838 | 9년 전 | 491 | ||
| 7837 | 9년 전 | 334 | ||
| 7836 | 9년 전 | 374 | ||
| 7835 | 9년 전 | 451 | ||
| 7834 |
|
9년 전 | 1176 | |
| 7833 | 9년 전 | 391 | ||
| 7832 | 9년 전 | 391 | ||
| 7831 | 9년 전 | 526 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기