Monthly Archives: March 2009

mount ISO, CUE/BIN, NRG, IMG, MDF

sudo mount -o loop file.iso mountpoint
sudo mount -o loop -t iso9660 file.iso mountpoint

bchunk file.bin file.cue file.iso
mdf2iso file.mdf file.iso
ccd2iso file.img file.iso
nrg2iso file.nrg file.iso
sudo mount -o loop,offset=307200 file.nrg mountpoint

bash loop

line-based list expansion:

(IFS=$'\n';for i in $(cat /tmp/foo);do
echo $i
done)

I’m always forgetting the syntax to make “for” loops in Bash. I guess it serves me right for using foreach most of my UNIX life instead. Anyhow, I know I will have to come back here to find it, so I thought I would write put up this quick example with the hope that it will be useful to others as well.

for i in $(seq 1 100); do echo -n “file${i} “; touch file${i} 2>&1; done

The the above for loop will c
reate 100 files (called file1, file2, etc.).

http://spiralbound.net/2007/07/23/bash-for-loop-example