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

📄 copy-cd.sh

📁 BASH Shell 编程 经典教程 《高级SHELL脚本编程》中文版
💻 SH
字号:
#!/bin/bash# copy-cd.sh: copying a data CDCDROM=/dev/cdrom                           # CD ROM deviceOF=/home/bozo/projects/cdimage.iso         # output file#       /xxxx/xxxxxxx/                     Change to suit your system.BLOCKSIZE=2048SPEED=2                                    # May use higher speed if supported.DEVICE=cdrom# DEVICE="0,0"    on older versions of cdrecord.echo; echo "Insert source CD, but do *not* mount it."echo "Press ENTER when ready. "read ready                                 # Wait for input, $ready not used.echo; echo "Copying the source CD to $OF."echo "This may take a while. Please be patient."dd if=$CDROM of=$OF bs=$BLOCKSIZE          # Raw device copy.echo; echo "Remove data CD."echo "Insert blank CDR."echo "Press ENTER when ready. "read ready                                 # Wait for input, $ready not used.echo "Copying $OF to CDR."cdrecord -v -isosize speed=$SPEED dev=$DEVICE $OF# Uses Joerg Schilling's "cdrecord" package (see its docs).# http://www.fokus.gmd.de/nthp/employees/schilling/cdrecord.htmlecho; echo "Done copying $OF to CDR on device $CDROM."echo "Do you want to erase the image file (y/n)? "  # Probably a huge file.read answercase "$answer" in[yY]) rm -f $OF      echo "$OF erased."      ;;*)    echo "$OF not erased.";;esacecho# Exercise:# Change the above "case" statement to also accept "yes" and "Yes" as input.exit 0

⌨️ 快捷键说明

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