I added some information on some of the new stuff in the OpenBSD
disklabel(8) portion of the installation process on my page at:
There’s a link there, too, to a good write-up on preserving your disk layout:
Preserving an existing OpenBSD partition layout during a re-install
Also picked up on a good way today to rename multiple files using perl:
ls -1 | perl -nle’$o=$_; s/OLDPATTERN/NEWPATTERN/; $n=$_; rename($o,$n)if!-e$n’
Pretty nifty. You can rename any part of the file names.
Cheers
when ls is outputting to something that isn’t a terminal (like a pipe) it defaults to -1 so the switch is redundant. Interesting and potentially useful.
Comment by Andrew Fresh — April 20, 2010 @ 7:39 am
You’re absolutely correct. I guess whoever put that together to begin with,
and I can’t recall where I read it when I was trying to figure out how to do
it all in one line, figured it was just a good habit. But you’re right. In this
particular instance, with the output being piped as it is, the 1 is redundant.
Comment by denny — April 20, 2010 @ 6:26 pm
[...] This post was mentioned on Twitter by Denny White. Denny White said: OpenBSD Partitioning Trick Update: Denny's OpenBSD Newbies blog: http://bit.ly/cjSfVQ [...]
Pingback by Tweets that mention Partitioning Trick Update « Denny’s OpenBSD Newbies blog -- Topsy.com — April 28, 2010 @ 2:48 pm
Here’s a way to do it recursively:
perl -MFile::Find -e ‘find(sub {if (-f and /oldpattern/) \
{ $old = $_; s/oldpattern/newpattern/g; rename $old, $_}}, “.”)’
Comment by denny — April 30, 2010 @ 12:11 am