* 2026-02-19 21:45:23-0800, Chime Hart wrote:

> Hi David: You mention "rename" when I was in DOS they had an "ren" which I 
> wish 
> I had in Debian, as it handled wild-cards really well. I could type
> ren *.txt *.cnn
> Sure wish we had something simple like that. Thanks in advance

Usually not because the "culture" in Linux/Unix world is that
command-line interpreter (shell) handles filename expansion, variable
expansion and various other expansions. Simple commands don't expand
anything; they just take filenames.

One may see this as bad but it is also a good thing. Different programs
don't have different semantics for expansion. When only one component
(shell) makes all expansions the meaning is clearer and the escape
technique that prevents the expansion is clear.

Of course we may need a command to rename all *.txt files to *.cnn
files. Maybe someone has written a tool for that. We can write our own
shell loop to do that.

In Bash shell, which most people use:

    for f in *.txt; do mv "$f" "${f%*.txt}.cnn"; done

In Fish shell, a bit clearer:

    for f in *.txt; mv $f (path change-extension cnn $f); end


-- 
/// Teemu Likonen - .-.. https://www.iki.fi/tlikonen/
// OpenPGP: DD3B8E8ABD28B98176E6A7CCCC9A5E615FCC1D93
/ old key: 6965F03973F0D4CA22B9410F0F2CAE0E07608462

Attachment: signature.asc
Description: PGP signature

Reply via email to