Shell command (1)--Variable

Source: Internet
Author: User

Shell variables:

1. System Variables:

  • $n: Parameters of the command, n indicates the order of the arguments
  • $#: Number of parameters
  • $: Program Name
  • $?: return value of previous command or function
  • $*: Saving parameters as a string
  • [Email protected]: Save parameters as an array of characters
  • $$: ID number of the current program
  • $!: ID number of the previous command

2. Environment variables:

  • Path: Command search path.
  • Home: The user's home directory
  • Histfile: Historical Command file
  • Histsize: The maximum number of commands contained in a command history file
  • LOGNAME: Current user name
  • Shell: The directory where the current shell resides
  • Term: terminal type
  • Ld_library_path: library file search for Soviet path

To view environment variables, use echo $. For example: Echo $ $TERM

Shell command (1)--Variable

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.