|
Home > Archive > Unix Shell > February 2005 > multiple .profile edits
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
multiple .profile edits
|
|
| Dale DeRemer 2005-02-23, 7:54 am |
| I actually have two questions.
First, we have the following line in the .profile of our users, (this was
setup before I got here).
trap "" 1 2 3
I'm guessing it's meant to trap ^C and keep users in a menu script that's
called in the .profile. I looked at the man page, but it was something less
than informative for someone at my level.
Second, we want that line gone. We have about 300 users, and the structure
goes like this:
/home/sj12345
/home/mp02010
Where the number is pseudo random and the letters are first and last
initial.
Anyone have a suggestion for an efficient way to edit all the .profiles?
Also, not all .profiles are the same. Copying an altered version over the
existing one is not a good option.
Thanks
| |
| Chris F.A. Johnson 2005-02-23, 7:54 am |
| On Tue, 22 Feb 2005 at 18:35 GMT, Dale DeRemer wrote:
> I actually have two questions.
> First, we have the following line in the .profile of our users, (this was
> setup before I got here).
> trap "" 1 2 3
> I'm guessing it's meant to trap ^C and keep users in a menu script that's
> called in the .profile. I looked at the man page, but it was something less
> than informative for someone at my level.
It traps signals 1, 2, and 3 (SIGHUP, SIGINT and SIGQUIT) and does
nothing when they are received (2, SIGINT, is ^C).
> Second, we want that line gone. We have about 300 users, and the structure
> goes like this:
> /home/sj12345
> /home/mp02010
> Where the number is pseudo random and the letters are first and last
> initial.
> Anyone have a suggestion for an efficient way to edit all the .profiles?
> Also, not all .profiles are the same. Copying an altered version over the
> existing one is not a good option.
for rc in /home/*/.profile
do
sed 's/trap "" 1 2 3//' "$rc" > tempfile &&
mv tempfile "$rc"
done
--
Chris F.A. Johnson http://cfaj.freeshell.org/shell
========================================
===========================
My code (if any) in this post is copyright 2005, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
| |
| Dale DeRemer 2005-02-23, 6:01 pm |
| > for rc in /home/*/.profile
> do
> sed 's/trap "" 1 2 3//' "$rc" > tempfile &&
> mv tempfile "$rc"
> done
>
> --
> Chris F.A. Johnson http://cfaj.freeshell.org/shell
> ========================================
===========================
> My code (if any) in this post is copyright 2005, Chris F.A. Johnson
> and may be copied under the terms of the GNU General Public License
I just wanted to be sure to thank you for your reply. You've helped me
multiple times, either with a direct reply or reading your replies to other
posts. When I see one of your posts I have a high degree of confidence that
it's helpful.
Thank you.
| |
| Dale DeRemer 2005-02-23, 6:01 pm |
| > --
> Chris F.A. Johnson http://cfaj.freeshell.org/shell
> ========================================
===========================
> My code (if any) in this post is copyright 2005, Chris F.A. Johnson
> and may be copied under the terms of the GNU General Public License
I just wanted to be sure to thank you for your reply. You've helped me
multiple times, either with a direct reply or reading your replies to other
posts. When I see one of your posts I have a high degree of confidence that
it's helpful.
Thank you.
| |
| Dale DeRemer 2005-02-23, 6:01 pm |
| > Chris F.A. Johnson http://cfaj.freeshell.org/shell
I just wanted to be sure to thank you for your reply. You've helped me
multiple times, either with a direct reply or reading your replies to other
posts. When I see one of your posts I have a high degree of confidence that
it's helpful.
Thank you.
|
|
|
|
|