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

📄 poem.sh

📁 Shall高级编程
💻 SH
字号:
#!/bin/bash# poem.sh: Pretty-prints one of the document author's favorite poems.# Lines of the poem (single stanza).Line[1]="I do not know which to prefer,"Line[2]="The beauty of inflections"Line[3]="Or the beauty of innuendoes,"Line[4]="The blackbird whistling"Line[5]="Or just after."# Attribution.Attrib[1]=" Wallace Stevens"Attrib[2]="\"Thirteen Ways of Looking at a Blackbird\""# This poem is in the Public Domain (copyright expired).echofor index in 1 2 3 4 5    # Five lines.do  printf "     %s\n" "${Line[index]}"donefor index in 1 2          # Two attribution lines.do  printf "          %s\n" "${Attrib[index]}"doneechoexit 0# Exercise:# --------# Modify this script to pretty-print a poem from a text data file.

⌨️ 快捷键说明

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