- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- edit on .profile
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2002 12:28 PM
08-05-2002 12:28 PM
Thank you....
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2002 12:37 PM
08-05-2002 12:37 PM
Re: edit on .profile
---- script starts -----
#!/bin/sh
find /home -type f -name '.profile' | while read FILE
do
if [ `grep umask $FILE` -eq 0 ]
then
grep -v umask > $FILE.new
cp $FILE.new $FILE
rm $FILE.new
fi
done
----- script ends ------
Hai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2002 12:55 PM
08-05-2002 12:55 PM
Re: edit on .profile
Error:
./rmumask.com[5]: test: Specify a parameter with this command.
Thank You....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2002 01:00 PM
08-05-2002 01:00 PM
Re: edit on .profile
Thanks
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2002 01:03 PM
08-05-2002 01:03 PM
Re: edit on .profile
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2002 01:07 PM
08-05-2002 01:07 PM
Re: edit on .profile
Can you post the file?
Also in case you do not know, you need to make the file executable as follows:
# chmod 755 rmumask.com
By the way, I believe that there is no error in my script.
Hai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2002 01:15 PM
08-05-2002 01:15 PM
Re: edit on .profile
< ca_tok1 > /tmp #more rmumask.com
#!/bin/sh
find /home -type f -name '.profile' | while read FILE
do
if [ `grep umask $FILE` -eq 0 ]
then
grep -v umask > $FILE.new
cp $FILE.new $FILE
rm $FILE.new
fi
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2002 01:15 PM
08-05-2002 01:15 PM
Re: edit on .profile
Actually, there is a logical missing in my script. It should have been as follows:
---- script starts -----
#!/bin/sh
find /home -type f -name '.profile' | while read FILE
do
grep umask $FILE >/dev/null
if [ `echo $?` -eq 0 ]
then
grep -v umask > $FILE.new
cp $FILE.new $FILE
rm $FILE.new
fi
done
----- script ends ------
Sorry. It must work this time.
Hai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2002 01:17 PM
08-05-2002 01:17 PM
SolutionI spotted another missing parameter. This is the final one:
---- script starts -----
#!/bin/sh
find /home -type f -name '.profile' | while read FILE
do
grep umask $FILE >/dev/null
if [ `echo $?` -eq 0 ]
then
grep -v umask $FILE > $FILE.new
cp $FILE.new $FILE
rm $FILE.new
fi
done
----- script ends ------
Hai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2002 01:36 PM
08-05-2002 01:36 PM
Re: edit on .profile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2002 01:40 PM
08-05-2002 01:40 PM
Re: edit on .profile
I'm glad that I could help.
Hai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2002 06:08 AM
08-07-2002 06:08 AM
Re: edit on .profile
cat /etc/passwd|awk -F: '{print $6}'|while read i
do
#safe a copy of each .profile to .profile.org
cp ${i}/.profile ${i}/.profile.org
#removes the line with umask in profile.new
cat ${i}/.profile |grep -v umask > ${i}/profile.new
#moves new profile to .profile
mv ${i}/profile.new ${i}/.profile
done