#!/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>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 430 | 19년 전 | 4094 | ||
| 429 | 19년 전 | 3290 | ||
| 428 | 19년 전 | 4125 | ||
| 427 | 19년 전 | 3465 | ||
| 426 | 19년 전 | 3099 | ||
| 425 | 19년 전 | 3393 | ||
| 424 | 19년 전 | 2435 | ||
| 423 | 19년 전 | 2854 | ||
| 422 | 19년 전 | 2343 | ||
| 421 | 19년 전 | 3703 | ||
| 420 | 19년 전 | 4728 | ||
| 419 | 19년 전 | 3783 | ||
| 418 |
|
19년 전 | 1736 | |
| 417 | 19년 전 | 2740 | ||
| 416 | 19년 전 | 2386 | ||
| 415 | 19년 전 | 2602 | ||
| 414 | 19년 전 | 4401 | ||
| 413 |
|
19년 전 | 2586 | |
| 412 | 19년 전 | 3036 | ||
| 411 |
|
19년 전 | 2984 | |
| 410 |
|
19년 전 | 3672 | |
| 409 |
|
19년 전 | 3628 | |
| 408 |
|
19년 전 | 1848 | |
| 407 | 19년 전 | 2222 | ||
| 406 | 19년 전 | 2774 | ||
| 405 | 19년 전 | 2438 | ||
| 404 | 19년 전 | 4292 | ||
| 403 | 19년 전 | 3298 | ||
| 402 |
NeoGenesis
|
19년 전 | 4085 | |
| 401 | 19년 전 | 2600 | ||
| 400 |
|
19년 전 | 2486 | |
| 399 | 19년 전 | 2948 | ||
| 398 | 19년 전 | 2479 | ||
| 397 | 19년 전 | 2776 | ||
| 396 | 19년 전 | 2466 | ||
| 395 | 19년 전 | 3173 | ||
| 394 | 19년 전 | 1708 | ||
| 393 | 19년 전 | 2985 | ||
| 392 | 19년 전 | 2243 | ||
| 391 | 19년 전 | 2174 | ||
| 390 | 19년 전 | 2276 | ||
| 389 | 19년 전 | 2640 | ||
| 388 | 19년 전 | 2145 | ||
| 387 | 19년 전 | 4477 | ||
| 386 |
|
19년 전 | 2681 | |
| 385 |
|
19년 전 | 2472 | |
| 384 | 19년 전 | 2999 | ||
| 383 | 19년 전 | 3042 | ||
| 382 | 19년 전 | 3098 | ||
| 381 |
|
19년 전 | 2627 | |
| 380 |
|
19년 전 | 3010 | |
| 379 | 19년 전 | 2542 | ||
| 378 | 19년 전 | 2201 | ||
| 377 | 19년 전 | 2775 | ||
| 376 | 19년 전 | 2465 | ||
| 375 |
|
19년 전 | 2552 | |
| 374 | 19년 전 | 3806 | ||
| 373 | 19년 전 | 3260 | ||
| 372 | 19년 전 | 4982 | ||
| 371 |
세은아빠2
|
19년 전 | 2408 | |
| 370 | 19년 전 | 4495 | ||
| 369 | 19년 전 | 3104 | ||
| 368 | 19년 전 | 2886 | ||
| 367 | 19년 전 | 3721 | ||
| 366 | 19년 전 | 2637 | ||
| 365 | 19년 전 | 3727 | ||
| 364 | 19년 전 | 4004 | ||
| 363 | 19년 전 | 3428 | ||
| 362 | 19년 전 | 3470 | ||
| 361 | 19년 전 | 4097 | ||
| 360 |
hwatta
|
19년 전 | 2354 | |
| 359 | 19년 전 | 5095 | ||
| 358 | 19년 전 | 3650 | ||
| 357 | 19년 전 | 2589 | ||
| 356 |
sdesign1s
|
19년 전 | 2270 | |
| 355 | 20년 전 | 2741 | ||
| 354 | 20년 전 | 3021 | ||
| 353 | 20년 전 | 2785 | ||
| 352 |
|
20년 전 | 5765 | |
| 351 |
|
20년 전 | 2697 | |
| 350 |
|
20년 전 | 4282 | |
| 349 |
hwatta
|
20년 전 | 2175 | |
| 348 | 20년 전 | 7303 | ||
| 347 | 20년 전 | 2407 | ||
| 346 | 20년 전 | 3494 | ||
| 345 | 20년 전 | 4299 | ||
| 344 | 20년 전 | 2629 | ||
| 343 | 20년 전 | 3913 | ||
| 342 | 20년 전 | 3061 | ||
| 341 | 20년 전 | 4081 | ||
| 340 |
|
20년 전 | 5125 | |
| 339 |
|
20년 전 | 4225 | |
| 338 | 20년 전 | 5858 | ||
| 337 | 20년 전 | 2033 | ||
| 336 |
|
20년 전 | 3304 | |
| 335 |
|
20년 전 | 3531 | |
| 334 |
|
20년 전 | 2914 | |
| 333 |
hwatta
|
20년 전 | 2424 | |
| 332 | 20년 전 | 4647 | ||
| 331 | 20년 전 | 2262 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기