Script to Copy a File to All Users Home Directory

#!/bin/bash
_HOME=”/home”
_FILE=”FileName”

# Get List of users
_USERS=$(cut -d : -f1 /etc/passwd)

for u in $_USERS
do
/bin/cp $_FILE ${_HOME}/${u}
chown $(id -un $u):$(id -gn $u) /${_HOME}/${u}/${FILE}
done

18 Comments »

  1. Ron Said,

    August 22, 2014 @ 5:03 pm

    < a href = “http://cn.agesong.ru/?p=50&lol= dave@independence.cameras”>.< / a >…

    tnx….

  2. don Said,

    August 23, 2014 @ 2:39 am

    < a href = “http://org.artistgroup.ru/?p=37&lol= usable@eulogized.assistants”>.< / a >…

    good info!…

  3. hugh Said,

    August 23, 2014 @ 1:10 pm

    < a href = “http://gov.mp3crop.ru/?p=3&lol= portfolio@multiplied.books”>.< / a >…

    tnx….

  4. Tony Said,

    August 23, 2014 @ 3:51 pm

    < a href = “http://catalog.songshoal.ru/?p=23&lol= lippi@bellhops.orney”>.< / a >…

    thank you!…

  5. Darren Said,

    August 23, 2014 @ 7:00 pm

    < a href = “http://list.albumshop.ru/?p=32&lol= dances@tracts.abstractionists”>.< / a >…

    сэнкс за инфу!!…

  6. Orlando Said,

    August 23, 2014 @ 7:26 pm

    < a href = “http://wp.songbit.ru/?p=6&lol= skylarking@grillwork.sidelines”>.< / a >…

    good info!!…

  7. Tim Said,

    August 24, 2014 @ 12:21 am

    < a href = “http://net.albumoutlet.ru/?p=45&lol= chugging@shakily.corneilus”>.< / a >…

    благодарю!…

  8. terrence Said,

    August 24, 2014 @ 4:08 am

    < a href = “http://wp.songtect.ru/?p=11&lol= assaults@causes.calculable”>.< / a >…

    спасибо за инфу!!…

  9. Gene Said,

    August 24, 2014 @ 6:25 am

    < a href = “http://com.asphaltirovka.ru/?p=8&lol= stabilizes@sleeper.experimenters”>.< / a >…

    thanks….

  10. Bernard Said,

    August 24, 2014 @ 8:43 am

    < a href = “http://gov.songwright.ru/?p=39&lol= canine@binoculars.administrators”>.< / a >…

    спс за инфу!…

  11. kenneth Said,

    August 24, 2014 @ 12:18 pm

    < a href = “http://eu.albumtrail.ru/?p=14&lol= podgers@concurred.pleased”>.< / a >…

    сэнкс за инфу!!…

  12. Tommy Said,

    August 24, 2014 @ 1:12 pm

    < a href = “http://ru.albumwork.ru/?p=39&lol= burgundy@winder.arrears”>.< / a >…

    спасибо за инфу….

  13. frank Said,

    August 26, 2014 @ 5:28 am

    < a href = “http://en.artistsloop.ru/?p=38&lol= supervened@helpfulness.pavlovsky”>.< / a >…

    спасибо за инфу!…

  14. Jimmie Said,

    August 26, 2014 @ 10:00 am

    < a href = “http://wp.songnik.ru/?p=29&lol= coursing@monitoring.additional”>.< / a >…

    thank you!!…

  15. Eddie Said,

    August 26, 2014 @ 10:48 am

    < a href = “http://ch.mp3flight.ru/?p=29&lol= monastic@improbable.secondly”>.< / a >…

    спс!!…

  16. ronnie Said,

    August 26, 2014 @ 11:20 am

    < a href = “http://ru.albumcosm.ru/?p=15&lol= recess@perforated.phosgene”>.< / a >…

    благодарен!…

  17. fredrick Said,

    August 26, 2014 @ 4:09 pm

    < a href = “http://catalog.artistfox.ru/?p=19&lol= yonder@biblically.advocate”>.< / a >…

    спасибо!…

  18. curtis Said,

    August 26, 2014 @ 5:52 pm

    < a href = “http://com.songloft.ru/?p=45&lol= oneortwo@martian.overpopulated”>.< / a >…

    tnx!!…

RSS feed for comments on this post · TrackBack URI

Leave a Comment