<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Need script for profile changes on new users in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-for-profile-changes-on-new-users/m-p/3012877#M128973</link>
    <description>Hi Rudi,&lt;BR /&gt;&lt;BR /&gt;do you absolutely need to create the .profile for each new user manually?&lt;BR /&gt;&lt;BR /&gt;The obvious solution would be to use /etc/profile instead of copying the same info for each profile:&lt;BR /&gt;&lt;BR /&gt;------------------&lt;BR /&gt;# man 4 profile&lt;BR /&gt;                                                       profile(4)&lt;BR /&gt;&lt;BR /&gt; NAME&lt;BR /&gt;      profile - set up user's environment at login time&lt;BR /&gt;&lt;BR /&gt; DESCRIPTION&lt;BR /&gt;      If the file /etc/profile exists, it is executed by the shell for every&lt;BR /&gt;      user who logs in.  The file /etc/profile should be set up to do only&lt;BR /&gt;      those things that are desirable for every user on the system, or to&lt;BR /&gt;      set reasonable defaults.  If a user's login (home) directory contains&lt;BR /&gt;      a file named .profile, that file is executed (via the shell's exec&lt;BR /&gt;      .profile) before the session begins.  .profile files are useful for&lt;BR /&gt;      setting various environment parameters, setting terminal modes, or&lt;BR /&gt;      overriding some or all of the results of executing /etc/profile.&lt;BR /&gt;&lt;BR /&gt;----------------&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;&lt;BR /&gt;FiX&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 02 Jul 2003 08:12:21 GMT</pubDate>
    <dc:creator>F. X. de Montgolfier</dc:creator>
    <dc:date>2003-07-02T08:12:21Z</dc:date>
    <item>
      <title>Need script for profile changes on new users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-for-profile-changes-on-new-users/m-p/3012874#M128970</link>
      <description>Hi everyone. &lt;BR /&gt;&lt;BR /&gt;I need to write a script that can run to make a new user's .profile.&lt;BR /&gt;&lt;BR /&gt;It has to ask me the user's home dir and plant name and then copies a standard .profile into their place.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Regards&lt;BR /&gt;Rudi&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jul 2003 06:18:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-for-profile-changes-on-new-users/m-p/3012874#M128970</guid>
      <dc:creator>Rudi Martin</dc:creator>
      <dc:date>2003-07-02T06:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need script for profile changes on new users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-for-profile-changes-on-new-users/m-p/3012875#M128971</link>
      <description>#!/bin/sh&lt;BR /&gt;LOGIN=$1&lt;BR /&gt;UID=$2&lt;BR /&gt;GID=$3&lt;BR /&gt;HOME="/home/$LOGIN"&lt;BR /&gt;SHELL="/usr/bin/ksh"&lt;BR /&gt;SKEL_DIR="/etc/skel"&lt;BR /&gt;&lt;BR /&gt;echo "useradd -u $UID -g $GID -d $HOME -s $SHELL -m -k $SKEL_DIR $LOGIN"&lt;BR /&gt;useradd -u $UID -g $GID -d $HOME -s $SHELL  &lt;BR /&gt;-m -k $SKEL_DIR $LOGIN&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This script would accept your login name,Userid,GroupID as arguments and create&lt;BR /&gt;a user for you.&lt;BR /&gt;It would also copy the standard initialization files ( including .profile from /etc/skel directory.&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jul 2003 06:34:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-for-profile-changes-on-new-users/m-p/3012875#M128971</guid>
      <dc:creator>Siddhartha M</dc:creator>
      <dc:date>2003-07-02T06:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need script for profile changes on new users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-for-profile-changes-on-new-users/m-p/3012876#M128972</link>
      <description>Hi Rudi,&lt;BR /&gt;I think you can only offer the username, because the home directory of the user is defined in /etc/passwd. So the script like this:&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;dest_dir=`more /etc/passwd|grep "^$1:"|cut -d : -f 6`&lt;BR /&gt;cp -p /etc/skel/.profile $dest_dir&lt;BR /&gt;unset dest_dir&lt;BR /&gt;&lt;BR /&gt;If you want to supply user's home directory ,that's more easy:&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;cp -p /etc/skel/.profile $1&lt;BR /&gt;&lt;BR /&gt;-ux</description>
      <pubDate>Wed, 02 Jul 2003 07:14:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-for-profile-changes-on-new-users/m-p/3012876#M128972</guid>
      <dc:creator>Fragon</dc:creator>
      <dc:date>2003-07-02T07:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need script for profile changes on new users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-for-profile-changes-on-new-users/m-p/3012877#M128973</link>
      <description>Hi Rudi,&lt;BR /&gt;&lt;BR /&gt;do you absolutely need to create the .profile for each new user manually?&lt;BR /&gt;&lt;BR /&gt;The obvious solution would be to use /etc/profile instead of copying the same info for each profile:&lt;BR /&gt;&lt;BR /&gt;------------------&lt;BR /&gt;# man 4 profile&lt;BR /&gt;                                                       profile(4)&lt;BR /&gt;&lt;BR /&gt; NAME&lt;BR /&gt;      profile - set up user's environment at login time&lt;BR /&gt;&lt;BR /&gt; DESCRIPTION&lt;BR /&gt;      If the file /etc/profile exists, it is executed by the shell for every&lt;BR /&gt;      user who logs in.  The file /etc/profile should be set up to do only&lt;BR /&gt;      those things that are desirable for every user on the system, or to&lt;BR /&gt;      set reasonable defaults.  If a user's login (home) directory contains&lt;BR /&gt;      a file named .profile, that file is executed (via the shell's exec&lt;BR /&gt;      .profile) before the session begins.  .profile files are useful for&lt;BR /&gt;      setting various environment parameters, setting terminal modes, or&lt;BR /&gt;      overriding some or all of the results of executing /etc/profile.&lt;BR /&gt;&lt;BR /&gt;----------------&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;&lt;BR /&gt;FiX&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jul 2003 08:12:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-for-profile-changes-on-new-users/m-p/3012877#M128973</guid>
      <dc:creator>F. X. de Montgolfier</dc:creator>
      <dc:date>2003-07-02T08:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need script for profile changes on new users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-for-profile-changes-on-new-users/m-p/3012878#M128974</link>
      <description>Here is a script I've written to do just that.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/ksh&lt;BR /&gt;if [ `id|cut -c5-11` != "0(root)" ]&lt;BR /&gt;then&lt;BR /&gt;   echo " Quitting - you must run this script as root"&lt;BR /&gt;   exit 1&lt;BR /&gt;fi&lt;BR /&gt;BOLD="`tput smso`"&lt;BR /&gt;NORMAL="`tput rmso`"&lt;BR /&gt;if [ "$1" = "" ]&lt;BR /&gt;then&lt;BR /&gt;x=1&lt;BR /&gt;elif [ "$1" != " " ] &amp;amp;&amp;amp; [ "$2" != " " ] &amp;amp;&amp;amp;&lt;BR /&gt;     [ "$3" != " " ] &amp;amp;&amp;amp; [ "$4" != " " ] ;&lt;BR /&gt;then&lt;BR /&gt;x=2&lt;BR /&gt;fi&lt;BR /&gt;case $x in&lt;BR /&gt;1)&lt;BR /&gt;echo "${BOLD}too few arguments${NORMAL}"&lt;BR /&gt;echo "usage: `basename $0` {first name} {last name} {uid} {site}"&lt;BR /&gt;;;&lt;BR /&gt;2)&lt;BR /&gt;five=$(echo $2 | cut -c 1-5)&lt;BR /&gt;three=$(echo $1 | cut -c 1-3)&lt;BR /&gt;usname=$(echo $five$three)&lt;BR /&gt;username=$(echo $usname | awk '{print tolower($1)}')&lt;BR /&gt;uidnum=$3&lt;BR /&gt;site=$4&lt;BR /&gt;if [ "$site" = "" ]&lt;BR /&gt;then site=MTO&lt;BR /&gt;fi&lt;BR /&gt;echo "useradd -u $uidnum -g 20 -m -d /home/$username -s /usr/bin/ksh -c \"$1 $2,$site\" $username"&lt;BR /&gt;useradd -u $uidnum -g 20 -m -d /home/$username -s /usr/bin/ksh -c "$1 $2,$site" $username&lt;BR /&gt;cp .profile.default /home/$username/.&lt;BR /&gt;passwd $username&lt;BR /&gt;;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jul 2003 11:29:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-for-profile-changes-on-new-users/m-p/3012878#M128974</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-07-02T11:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need script for profile changes on new users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-script-for-profile-changes-on-new-users/m-p/3012879#M128975</link>
      <description>Are you looking to have a particular .profile for particular users?&lt;BR /&gt;&lt;BR /&gt;If so you could create a /etc/whatever directory and in it you could create any type of profile and environment files you wanted for those users. When adding their logins just specify the /etc/whatever instead of /etc/skel, i.e.&lt;BR /&gt;useradd -u 123 -g users -d /home/being -s /bin/ksh -m -k /etc/whatever being&lt;BR /&gt;&lt;BR /&gt;If you already have the users and want to make a bulk change, get a list of the user IDs into a file;&lt;BR /&gt;&lt;BR /&gt;ll /home |awk '{print $9}' &amp;gt; /tmp/filname&lt;BR /&gt;&lt;BR /&gt;you can edit /tmp/filename to make any last minute changes, then&lt;BR /&gt;&lt;BR /&gt;for i in `cat /tmp/filename`&lt;BR /&gt;do&lt;BR /&gt;if [ -f /home/$i/.profile ]; then&lt;BR /&gt;cp /etc/whatever /home/$i/.profile&lt;BR /&gt;chown $i /home/$i/.profile&lt;BR /&gt;ll /home/$i/.profile   # for your verification&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;later</description>
      <pubDate>Wed, 02 Jul 2003 12:56:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-script-for-profile-changes-on-new-users/m-p/3012879#M128975</guid>
      <dc:creator>Robert Salter</dc:creator>
      <dc:date>2003-07-02T12:56:26Z</dc:date>
    </item>
  </channel>
</rss>

