- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to get the script file
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
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
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
11-21-2017 01:49 AM
11-21-2017 01:49 AM
how to get the script file
Suggest me how can get details of dcript file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2017 06:47 AM
11-21-2017 06:47 AM
Re: how to get the script file
First, identify which shell is configured for the user in question. In HP-UX, the default shell is the POSIX shell, or (/usr)/bin/sh.
Then, read the man page of the shell in question. In HP-UX, the man page sh(1) is an overview of the various system shells, and the actual man page of the POSIX shell is named "sh-posix". In there, you find a description of what happens when that particular shell is started up. Usually this description is under a heading like "Shell invocation", "INVOCATION" or similar.
"man sh-posix" says:
Shell InvocationIf the shell is invoked by an exec*() system call and the first character of argument zero (shell parameter 0) is dash (-), the shell is assumed to be a login shell and commands are read first from /etc/profile, then from either .profile in the current directory or $HOME/.profile if either file exists, and finally from the file named by performing parameter substitution on the value of the environment parameter ENV, if the file exists. If the -s option is not present and an arg is, a path search is performed on the first arg to determine the name of the script to execute. When running sh with arg, the script arg must have read permission and any setuid and setgid settings will be ignored. Commands are read as described below.
In other words, with the POSIX sh shell:
- if you are actually logging in, or switching users using "su -", the first script executed will be /etc/profile,
- then $HOME/.profile if it exists.
- on login or "su -", your current directory will be the user's home directory. If you somehow invoke the shell using the login shell convention in a non-home directory, then the .profile script in that directory may be executed instead of $HOME/.profile. But this would be an unusual case.
- If the environment variable $ENV is set and points to an existing file, then that file is executed as a script.
The (/usr)/bin/ksh shell behaves the same as the POSIX sh shell.
The scummy (/usr)/bin/csh shell, on the other hand, executes first /etc/csh.login if you are actually logging in, then $HOME/.login, and finally $HOME/.cshrc. But if you start a sub-shell, it always runs only $HOME/.cshrc and none of the other scripts.
Script files are text files: the system-wide login scripts (/etc/profile and /etc/csh.login) must be readable by anyone. So you can just run a command like
more /etc/profile
to view them.
Per-user login scripts may or may not be readable to other users; they certainly should not be writeable by anyone other than their owner.
The default versions of per-user scripts, that are copied to each user's home directory as the user account is created, are located in /etc/skel/ directory.