?? copy-cd.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 + -