zzl001 发表于 2018-8-19 14:57:29

Bash Shell 的参数符号意义

# cat filelist.sh  #!/bin/bash
  echo "general file list files: $#"
  echo "General by: $0"
  echo "Param1: $1" > filelist.txt
  echo "Param2: $2" >> filelist.txt
  echo "All param: $*" >> filelist.txt
  echo "All param: $@" >> filelist.txt
  echo "Flag: $-" >> filelist.txt
  echo "Last PID: $!" >> filelist.txt
  echo "Last command: $_"
  echo "Is normal: $?"
  echo "Current PID: $$"

页: [1]
查看完整版本: Bash Shell 的参数符号意义