- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: List of common mistakes
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
тАО10-27-2010 09:36 PM
тАО10-27-2010 09:36 PM
Re: List of common mistakes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2010 12:22 AM
тАО10-28-2010 12:22 AM
Re: List of common mistakes
So when in doubt how the shell would expand those globs it is often advisable to have a "dry-run" in advance to see what would get obliterated by prepending an echo statement to the command line (provided the expansion wouldn't affect hundreds of files which would impair readability).
As we most likely all make use of the shells' keystroke history feature such a practise can generally be easily exercised.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2010 12:59 AM
тАО10-28-2010 12:59 AM
Re: List of common mistakes
Except directories can't be removed if they still have files in them.
But if you are saying that you can remove the directory out from under yourself, I've had that happen to me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2010 08:29 AM
тАО10-28-2010 08:29 AM
Re: List of common mistakes
copy pasting the commands using mouse on PUTTY session ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2010 09:45 AM
тАО10-28-2010 09:45 AM
Re: List of common mistakes
Two practices that I use constantly:
Remove (or truncate with '>' or 'cat /dev/null >' the shell history file ('.sh_history') that contains the 'reboot' or 'shutdown' command from you last use. This prevents inadvertent command recall and re-execution if you move too quickly.
Get in the habit of using 'set -u' in your shell scripts. This makes unset parameters an error when substituting. What you want to avoid is running a script where you *think* a variable has been set, but it hasn't been and you do something like:
# rm -r /${MYPATH}
If '${MYPATH}' is empty, you just removed everything under the root directory. Ignite, anyone?
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2010 12:55 PM
тАО10-28-2010 12:55 PM
Re: List of common mistakes
> Is there a best way to avoid mistake by
copy pasting the commands using mouse on PUTTY session ?
- If you are trying to run some commands and may be really long commands from your desktop to putty, and trying to paste them, try getting them first on a file ,and then analyze the commands and then you can paste.
- Best open a vi session. $ vi temp-cmds
- ": se noai"
- "right click" , it will paste
- save and review the file. And you can select and paste for actual execution.
(- Remeber there is a chance of getting garbage character when pasting to putty, like "-" "converts to "." etc. so reviewing the pasted commands in vi, before actual executing would fix that.)
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2010 01:45 PM
тАО10-28-2010 01:45 PM
Re: List of common mistakes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2010 01:51 PM
тАО10-28-2010 01:51 PM
Re: List of common mistakes
It can have a special meaning to the TTY, especially if you are logging into a serial attached terminal (console).
From the WARNINGS section of the passwd man page:
*****
Avoid password characters which have special meaning to the tty driver, such as # (erase) and @ (kill). You may not be able to login with these characters.
*****
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2010 10:32 PM
тАО10-28-2010 10:32 PM
Re: List of common mistakes
> Is there any reason we should be avoiding @ in password ?
When logging in, the backspace key will NOT work (if you have mis-typed), use the # key to backspace one character at a time, or use @ to erase the line and start again.
This is why these characters are NOT allowed as part of your login name or password.
Another tip: There are a number of commands which can be run in "preview" mode like vgexport, swinstall, vgscan, make_tape_recovery etc. So, before actually running/executing these commands you can always run them in preview mode to see the outcome. If everything is fine, you can remove "p" and use rest of the command.
Example:
# vgscan -p
(here "p" is for preview mode)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2010 09:15 PM
тАО10-29-2010 09:15 PM
Re: List of common mistakes
if doing any lvm changes in cluster systems have a proper vg map file backup before and after changes.
All men make mistakes, but only wise men learn from their mistakes -- Winston Churchill.