⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tempfile-name.sh

📁 一本完整的描述Unix Shell 编程的工具书的所有范例
💻 SH
字号:
#!/bin/bash# tempfile-name.sh:  temp filename generatorBASE_STR=`mcookie`   # 32-character magic cookie.POS=11               # Arbitrary position in magic cookie string.LEN=5                # Get $LEN consecutive characters.prefix=temp          #  This is, after all, a "temp" file.                     #  For more "uniqueness," generate the filename prefix                     #+ using the same method as the suffix, below.suffix=${BASE_STR:POS:LEN}                     # Extract a 5-character string, starting at position 11.temp_filename=$prefix.$suffix                     # Construct the filename.echo "Temp filename = "$temp_filename""# sh tempfile-name.sh# Temp filename = temp.e19ea#  Compare this method of generating "unique" filenames#+ with the 'date' method in ex51.sh.exit 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -