Re: best external cd rom

2019-11-14 Thread Petr Baum via luv-main
On Tue, 29 Oct 2019 04:11:18 AM Rohan McLeod wrote:

Hi Rohan,
(and everybody...)

> >>> I have got a big box of about 25 years old CD ROM disks with scanned B/W
...
> >> 3/ When I was investigating this issue I came to the conclusion that
> >> "M-Disk"s were the best current solution;
> >>  this involves (a) buying an M-disk capable DVD R/W (most Blue-Ray
> >> drives) (b) a supply of M-Disks (25- 100)GB

I purchased LG GP57EB DVD Burner which claims to be M-disc compatible. I also 
purchased 2 boxes Verbatim M-disc Bdr 25gb 5pk to use for trials. Both 
mail-orders arrived recently.

I tried the new burner with ordinary DVD using brasero SW. It created 
small data DVD without any issues. I created 21.2 GiB .iso with brasero also 
without any issues. 

When I asked brasero to burn it and presented one M-disc in the burner it 
responded with "Please replace the disc with a supported CD or DVD". Search 
results for “M-disc” in brasero help returned: 'No matching help pages found 
in “Brasero Help”.

I also tried k3b with the same .iso. It asked for a disc, played a bit with 
inserted M-disc and then stopped, still asking for "an empty Blu-Ray medium"

So far no success but also no coaster...

Any advice what to try next would be appreciated.

Petr Baum

-- 


Petr Baum, P.O.Box 2364, Rowville 3178
fax +61-3-97643342

This message was created in naturally virus-free operating system: Linux
___
luv-main mailing list
luv-main@luv.asn.au
https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main


Re: Bash Recursive File Rename

2019-11-14 Thread David via luv-main
On Fri, 15 Nov 2019 at 12:51, Piers via luv-main  wrote:
>
> Hi there,

Hi

> I have a bunch of files that I want to rename:

For a range of approaches, have a look here:
http://mywiki.wooledge.org/BashFAQ/030

> ...sorry regex is a shortfall of mine.

There's no regex anywhere in your examples, only
"globs" aka shell pattern matching aka shell pathname
expansion. See here:
http://mywiki.wooledge.org/glob
http://mywiki.wooledge.org/RegularExpression

It's important to understand that these are distinct things.
They superficially might look similar, but they behave
differently. regex is more powerful, and more complicated.

A perl-based solution will require you to use regex notation.

A solution using 'find' and 'mv' with shell parameter expansion
(like your example)
http://mywiki.wooledge.org/BashFAQ/073
will require you to use glob notation.

So a first step might be to choose which of regex or glob you
prefer, and then proceed from there. Your problem statement
looks simple enough that regex is not required, unless you
choose an approach that mandates using regex.

Personally being already comfortable with both, I would
probably use a perl-based "rename" tool. It has a dry-run
option which is useful when you are unsure of the syntax.
___
luv-main mailing list
luv-main@luv.asn.au
https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main


Re: Bash Recursive File Rename

2019-11-14 Thread Craig Sanders via luv-main
On Fri, Nov 15, 2019 at 11:51:40AM +1000, Piers wrote:
> I have a bunch of files that I want to rename:
>
> 123.someword.doc > 123.doc
>
> 456.someword.pdf > 456.pdf
>
> The "someword" is consistent in all the files and they need to be renamed
> recursively.

Use the perl-based 'rename' tool (which is sometimes in the PATH as 'prename'
or 'file-rename' instead of just 'rename').

Note, this is **NOT** the same as the rename tool from util-linux (which has
completely different command-line options and capabilities, and is sometimes
called 'rename.ul').

On debian (and ubuntu, etc), 'apt-get install rename' if it isn't already
installed (run 'man rename' to see if it mentions Perl). On other distros,
install whatever package provides the perl File::Rename module.


Anyway, the perl 'rename' allows you to use ANY perl code, from trivial
sed-like search and replace to complex perl code blocks to rename files. e.g.
i've written rename commands that sort files into sub-directories by the
file's timestamp or name, convert them to TitleCase, change spaces to '_' or
'.' (or just remove them), AND change their permissions - all in one command.

But most of the time, I just need to do a regexp search and replace on the
filenames.  Like this:

rename -n 's/\.someword//' *someword*

NOTE: The '-n' is a dry-run, it shows you what would be renamed if you allowed
it.  To actually rename, get rid of the '-n' or replace it with '-v' for
verbose output.  BTW, rename won't overwrite existing files unless you force
it to with '-f'.


Perl rename can take a list of filenames on the command-line or from stdin, so 
you
could do a recursive rename with either of these:

find . -type f -name '*someword*' -exec rename -n 's/\.someword//' {} +

find . -type f -name '*someword*' -print0 | rename -n -0 's/\.someword//'

> Something like this but with a different regex:
>
> # This is for a completely different file name structure
>
> find . -name '123*.txt' -type f -exec bash -c 'mv "$1" "${1/\/123_//}"' -- {} 
> \;

You really don't want to be forking 'bash' AND 'mv' once for each matching file.

The following line tries to fit as many filenames on the command line as
will fit (the command line length limit is typically around 2MB these days),
so will almost always only run bash once. or maybe twice. as few times as
necessary, anyway.

   find . -name '123*.txt' -type f -exec bash -c 'for f in "$@"; do mv "$f" 
"${1/\/123_//}"; done' -- {} +

Note the use of '{} +' instead of '{} \;' - that's what makes 'find' try to
fit as many filenames onto a command-line as possible each time the -exec
option's command is executed.

Unfortunately, this still forks 'mv' once for each filename, so it's still going
to be slow.


Even better, don't use bash at all, use the right tool for the job:

find . -type f -name '123*.txt' -exec rename -n 's:/123_::' {} +

Or, to pipe a NUL separated list of filenames (to avoid command-line length
limits entirely):

find . -type f -name '123*.txt' -print0 | rename -n -0 's:/123_:/:'

(again, remove the '-n' or replace with '-v' to make it actually rename files
once you've verified that it does what you want).

craig

--
craig sanders 
___
luv-main mailing list
luv-main@luv.asn.au
https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main


Re: Bash Recursive File Rename

2019-11-14 Thread Paul van den Bergen via luv-main
https://www.maketecheasier.com/rename-files-in-linux/

On Fri, 15 Nov 2019 at 12:51, Piers via luv-main 
wrote:

> Hi there,
>
> I have a bunch of files that I want to rename:
>
>
> 123.someword.doc > 123.doc
>
> 456.someword.pdf > 456.pdf
>
> The "someword" is consistent in all the files and they need to be
> renamed recursively.
>
> Something like this but with a different regex:
>
> # This is for a completely different file name structure
>
> find . -name '123*.txt' -type f -exec bash -c 'mv "$1" "${1/\/123_//}"'
> -- {} \;
>
> ...sorry regex is a shortfall of mine.
>
> Thanks in advance.
>
> Cheers
>
> Piers
>
>
> ___
> luv-main mailing list
> luv-main@luv.asn.au
> https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main
>


-- 
Dr Paul van den Bergen
___
luv-main mailing list
luv-main@luv.asn.au
https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main


Bash Recursive File Rename

2019-11-14 Thread Piers via luv-main

Hi there,

I have a bunch of files that I want to rename:


123.someword.doc > 123.doc

456.someword.pdf > 456.pdf

The "someword" is consistent in all the files and they need to be 
renamed recursively.


Something like this but with a different regex:

# This is for a completely different file name structure

find . -name '123*.txt' -type f -exec bash -c 'mv "$1" "${1/\/123_//}"' 
-- {} \;


...sorry regex is a shortfall of mine.

Thanks in advance.

Cheers

Piers


___
luv-main mailing list
luv-main@luv.asn.au
https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main