- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Skipping execution of tail of /etc/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
Discussions
Discussions
Forums
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
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
тАО07-19-2004 01:04 AM
тАО07-19-2004 01:04 AM
I need a silly hack for /etc/profile on a Solaris box (but it is basic shell fare)
What greatly annoys me is the way the Solaris package manager is messing about with the global profile by cluttering it with ugly PATH and MANPATH additions whenever one does a pkgadd.
Not only is it mocking all attempts of "style" by comming up with its own idea of indentations and comments, it also prepends PATHs with unimportant package targets before login parses more important PATH settings from /etc/default/login.
Thus I thought, probably the easiest way to overcome this while not obstructing later package manager profile violations (viz. appendages), and relieving me from continous profile modifications, would be to drop in a return statement before the autogenerated mess starts, and relocating the PATH and MANPATH stuff in some ordered config file like HP-UX's /etc/MANPATH.
Though the "return" seems to work (in that the rest of the file is disregarded) I do get an irritating "-sh: cannot return when not in function".
Do you have a more sober hack?
Rgds.
Ralph
Solved! Go to Solution.
- Tags:
- profile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2004 01:14 AM
тАО07-19-2004 01:14 AM
Re: Skipping execution of tail of /etc/profile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2004 01:16 AM
тАО07-19-2004 01:16 AM
Re: Skipping execution of tail of /etc/profile
viz. kicking out anyone who logs in before they see a shell ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2004 01:21 AM
тАО07-19-2004 01:21 AM
Re: Skipping execution of tail of /etc/profile
"exec $SHELL"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2004 01:30 AM
тАО07-19-2004 01:30 AM
SolutionHow about: -
/bin/false <
This should pipe the remainder of the text file through /bin/false, which will just do nowt. The fact that there's no EOF token at the end of the file shouldn't matter since it'll just continue until the file closes (ie real end of file).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2004 01:33 AM
тАО07-19-2004 01:33 AM
Re: Skipping execution of tail of /etc/profile
yes, this works.
But things get a little complicated because root's personal .profile already bears an exec to a bash, which then is expected to source .bash_profile and .bashrc (to get the goodies from Bash scripting, which works when invoked with --login).
You see, I'm a lousy typer and have to rely on path completion, something the ordinary /sbin Bourne shell doesn't offer.
I will have to fumble a bit with the various profiles till I get it where I want it...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2004 01:36 AM
тАО07-19-2004 01:36 AM
Re: Skipping execution of tail of /etc/profile
brilliant hack!
That's exactly what I've been looking for :-)