#!/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>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 630 | 19년 전 | 2349 | ||
| 629 |
|
19년 전 | 2011 | |
| 628 |
|
19년 전 | 3126 | |
| 627 |
|
19년 전 | 2033 | |
| 626 |
|
19년 전 | 2066 | |
| 625 |
|
19년 전 | 1719 | |
| 624 |
|
19년 전 | 2223 | |
| 623 | 19년 전 | 2198 | ||
| 622 |
|
19년 전 | 2508 | |
| 621 |
|
19년 전 | 2910 | |
| 620 |
|
19년 전 | 2404 | |
| 619 | 19년 전 | 2472 | ||
| 618 | 19년 전 | 3515 | ||
| 617 |
|
19년 전 | 3232 | |
| 616 |
|
19년 전 | 3222 | |
| 615 |
|
19년 전 | 3038 | |
| 614 |
|
19년 전 | 2045 | |
| 613 |
|
19년 전 | 2378 | |
| 612 |
|
19년 전 | 2239 | |
| 611 |
|
19년 전 | 2085 | |
| 610 |
|
19년 전 | 2520 | |
| 609 |
|
19년 전 | 2421 | |
| 608 |
|
19년 전 | 2812 | |
| 607 | 19년 전 | 2194 | ||
| 606 | 19년 전 | 3531 | ||
| 605 | 19년 전 | 1989 | ||
| 604 | 19년 전 | 2600 | ||
| 603 | 19년 전 | 1612 | ||
| 602 |
|
19년 전 | 2836 | |
| 601 | 19년 전 | 3074 | ||
| 600 |
|
19년 전 | 2153 | |
| 599 | 19년 전 | 2002 | ||
| 598 | 19년 전 | 2481 | ||
| 597 | 19년 전 | 2389 | ||
| 596 |
|
19년 전 | 3074 | |
| 595 |
|
19년 전 | 6753 | |
| 594 | 19년 전 | 2709 | ||
| 593 | 19년 전 | 3186 | ||
| 592 |
|
19년 전 | 3089 | |
| 591 |
|
19년 전 | 1931 | |
| 590 | 19년 전 | 3365 | ||
| 589 | 19년 전 | 2209 | ||
| 588 |
|
19년 전 | 2707 | |
| 587 | 19년 전 | 2345 | ||
| 586 |
|
19년 전 | 4364 | |
| 585 | 19년 전 | 2487 | ||
| 584 | 19년 전 | 2758 | ||
| 583 |
|
19년 전 | 3522 | |
| 582 |
|
19년 전 | 3718 | |
| 581 |
|
19년 전 | 3256 | |
| 580 | 19년 전 | 2485 | ||
| 579 | 19년 전 | 3074 | ||
| 578 | 19년 전 | 3974 | ||
| 577 | 19년 전 | 3814 | ||
| 576 | 19년 전 | 1751 | ||
| 575 |
|
19년 전 | 2208 | |
| 574 |
|
19년 전 | 5403 | |
| 573 | 19년 전 | 6717 | ||
| 572 | 19년 전 | 2565 | ||
| 571 | 19년 전 | 2106 | ||
| 570 | 19년 전 | 2601 | ||
| 569 | 19년 전 | 3301 | ||
| 568 | 19년 전 | 3528 | ||
| 567 | 19년 전 | 2981 | ||
| 566 | 19년 전 | 2602 | ||
| 565 |
|
19년 전 | 4719 | |
| 564 |
|
19년 전 | 6728 | |
| 563 |
|
19년 전 | 5008 | |
| 562 |
|
19년 전 | 5950 | |
| 561 |
|
19년 전 | 2692 | |
| 560 |
|
19년 전 | 2539 | |
| 559 |
|
19년 전 | 2222 | |
| 558 |
|
19년 전 | 2302 | |
| 557 | 19년 전 | 4595 | ||
| 556 |
|
19년 전 | 4668 | |
| 555 | 19년 전 | 2507 | ||
| 554 | 19년 전 | 2175 | ||
| 553 | 19년 전 | 2525 | ||
| 552 |
|
19년 전 | 3166 | |
| 551 | 19년 전 | 2938 | ||
| 550 |
|
19년 전 | 1898 | |
| 549 |
|
19년 전 | 1957 | |
| 548 |
|
19년 전 | 3146 | |
| 547 |
|
19년 전 | 2357 | |
| 546 |
|
19년 전 | 3617 | |
| 545 |
|
19년 전 | 2547 | |
| 544 |
|
19년 전 | 1850 | |
| 543 |
|
19년 전 | 2454 | |
| 542 |
|
19년 전 | 1729 | |
| 541 |
|
19년 전 | 1408 | |
| 540 |
|
19년 전 | 1536 | |
| 539 |
|
19년 전 | 1804 | |
| 538 |
|
19년 전 | 1584 | |
| 537 |
|
19년 전 | 1780 | |
| 536 |
|
19년 전 | 1561 | |
| 535 |
|
19년 전 | 1960 | |
| 534 |
|
19년 전 | 1845 | |
| 533 |
|
19년 전 | 1448 | |
| 532 |
|
19년 전 | 1442 | |
| 531 |
|
19년 전 | 1357 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기