[opensuse] Special file copy need
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I have to copy some files from Linux to external media formatted as exfat. Some names have a colon, like: "chapter: 1" Several programs baulk saying "can not create file, no such file or directory". Is there some file browser that will "sanitize" names on the fly? "chapter_ 1" I can use krusader which will let me change the name of the destination file before starting, if I copy one by one. Maybe with krename... - -- Cheers Carlos E. R. (from 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCX4N0QBwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfV/fYAnjMZCktkTPoxEu5BIqz+ z2KrBGy2AJ92e3RcW4lPyFJvGpwoCmgGkiN7tQ== =oifB -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 10/11/20 5:08 PM, Carlos E. R. wrote:
Hi,
I have to copy some files from Linux to external media formatted as exfat. Some names have a colon, like:
"chapter: 1"
Several programs baulk saying "can not create file, no such file or directory".
Is there some file browser that will "sanitize" names on the fly?
"chapter_ 1"
I can use krusader which will let me change the name of the destination file before starting, if I copy one by one.
Maybe with krename...
-- Cheers
Carlos E. R. (from 15.1 x86_64 at Telcontar)
If you have a list of the filenames, you can use Kate's find and replace command. Select all the files. Find : Replace _ and Bob's ypur uncle. --doug -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sun, 11 Oct 2020 23:08:16 +0200 (CEST) "Carlos E. R." <robin.listas@telefonica.net> wrote:
I have to copy some files from Linux to external media formatted as exfat. Some names have a colon, like:
"chapter: 1"
Several programs baulk saying "can not create file, no such file or directory".
Is there some file browser that will "sanitize" names on the fly?
"chapter_ 1"
According to https://en.wikipedia.org/wiki/ExFAT "Allowed characters in filenames all Unicode characters except U+0000 (NUL) through U+001F (US) / (slash) \ (backslash) : (colon) * (asterisk) ? (question mark) " (quote) < (less than) > (greater than) and | (pipe) (encoding in UTF-16LE)" So unless the article is wrong, you need to find a program that behaves properly :)
I can use krusader which will let me change the name of the destination file before starting, if I copy one by one.
Maybe with krename...
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El 2020-10-11 a las 22:27 +0100, Dave Howorth escribió:
On Sun, 11 Oct 2020 23:08:16 +0200 (CEST) "Carlos E. R." <> wrote:
I have to copy some files from Linux to external media formatted as exfat. Some names have a colon, like:
"chapter: 1"
Several programs baulk saying "can not create file, no such file or directory".
Is there some file browser that will "sanitize" names on the fly?
"chapter_ 1"
According to https://en.wikipedia.org/wiki/ExFAT
"Allowed characters in filenames all Unicode characters except U+0000 (NUL) through U+001F (US) / (slash) \ (backslash) : (colon) * (asterisk) ? (question mark) " (quote) < (less than) > (greater than) and | (pipe) (encoding in UTF-16LE)"
So unless the article is wrong, you need to find a program that behaves properly :)
No, you got it wrong. The ":" is perfectly valid in Linux filenames, but it is not in MsDOS Windows filenames. I simply want a program that copies files from Linux to Windows disks sanitizing the filenames on the fly (leaving the source files intact). - -- Cheers Carlos E. R. (from openSUSE 15.1 (Legolas)) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCX4OhGBwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVW0cAoIFBRIbdr0Aqu+FXi5w2 TMnXjd0PAJ4lO87hUuEZOOBSHFkY7LZPcuN67w== =kqe0 -----END PGP SIGNATURE-----
On Mon, 12 Oct 2020 02:19:36 +0200 (CEST) "Carlos E. R." <robin.listas@telefonica.net> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
El 2020-10-11 a las 22:27 +0100, Dave Howorth escribió:
On Sun, 11 Oct 2020 23:08:16 +0200 (CEST) "Carlos E. R." <> wrote:
I have to copy some files from Linux to external media formatted as exfat. Some names have a colon, like:
"chapter: 1"
Several programs baulk saying "can not create file, no such file or directory".
Is there some file browser that will "sanitize" names on the fly?
"chapter_ 1"
According to https://en.wikipedia.org/wiki/ExFAT
"Allowed characters in filenames all Unicode characters except U+0000 (NUL) through U+001F (US) / (slash) \ (backslash) : (colon) * (asterisk) ? (question mark) " (quote) < (less than) > (greater than) and | (pipe) (encoding in UTF-16LE)"
So unless the article is wrong, you need to find a program that behaves properly :)
No, you got it wrong. The ":" is perfectly valid in Linux filenames, but it is not in MsDOS Windows filenames.
You said an exfat filesystem. I quoted the rules for exfat. Now you're changing the target. MSDOS is very restrictive as a target.
I simply want a program that copies files from Linux to Windows disks sanitizing the filenames on the fly (leaving the source files intact).
- -- Cheers Carlos E. R.
(from openSUSE 15.1 (Legolas))
-----BEGIN PGP SIGNATURE-----
iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCX4OhGBwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVW0cAoIFBRIbdr0Aqu+FXi5w2 TMnXjd0PAJ4lO87hUuEZOOBSHFkY7LZPcuN67w== =kqe0 -----END PGP SIGNATURE-----
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday, 2020-10-12 at 10:59 +0100, Dave Howorth wrote:
On Mon, 12 Oct 2020 02:19:36 +0200 (CEST) "Carlos E. R." <> wrote:
El 2020-10-11 a las 22:27 +0100, Dave Howorth escribió:
On Sun, 11 Oct 2020 23:08:16 +0200 (CEST) "Carlos E. R." <> wrote:
I have to copy some files from Linux to external media formatted as exfat. Some names have a colon, like:
"chapter: 1"
Several programs baulk saying "can not create file, no such file or directory".
Is there some file browser that will "sanitize" names on the fly?
"chapter_ 1"
According to https://en.wikipedia.org/wiki/ExFAT
"Allowed characters in filenames all Unicode characters except U+0000 (NUL) through U+001F (US) / (slash) \ (backslash) : (colon) * (asterisk) ? (question mark) " (quote) < (less than) > (greater than) and | (pipe) (encoding in UTF-16LE)"
So unless the article is wrong, you need to find a program that behaves properly :)
No, you got it wrong. The ":" is perfectly valid in Linux filenames, but it is not in MsDOS Windows filenames.
You said an exfat filesystem. I quoted the rules for exfat. Now you're changing the target. MSDOS is very restrictive as a target.
Sorry, we are not understanding one another. Yes, the destination is exfat, which is an MsDOS/Windows filesystem. Or perhaps only Windows. Shall we say a Microsoft filesystem? And Linux does not allow me to copy files that contain ":" in their names, just a fact. I don't know what the wikipedia says, the problem is what Linux will allow me to write. I tried several programs, all of them fail with strange errors similar to the one I quoted by hand. The ":" is interpreted as a "drive" separator. - -- Cheers, Carlos E. R. (from openSUSE 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCX4QsYRwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVHtgAn12NeEL2OwXHc1wDpekL awyyKMA4AKCT7LJBsKtJ6B5hKyDCPVDcUfMOxQ== =yb51 -----END PGP SIGNATURE-----
On 12/10/2020 06:13, Carlos E. R. wrote:
And Linux does not allow me to copy files that contain ":" in their names, just a fact. I don't know what the wikipedia says, the problem is what Linux will allow me to write. I tried several programs, all of them fail with strange errors similar to the one I quoted by hand.
Well the shell does. echo "file:name" cp "file:name" "file:name2" ls -l file* -rw-r--r-- 1 anton anton 1 Oct 12 07:56 file:name -rw-r--r-- 1 anton anton 1 Oct 12 07:56 file:name2 Yes, I quoted the parameters. It's also why you can have file names with spaces in them Mind you, there are many poor quality scripts that blow up when they encounter a list of files some of which have spaces in the names. That is until someone recognises the need to make sure parameters are quoted. And there are situations where quotes get stripped off, so you need to either put them back somewhere in the script or 'double quote'. -- “Reality is so complex, we must move away from dogma, whether it’s conspiracy theories or free-market,” -- James Glattfelder. http://jth.ch/jbg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 14.11, Anton Aylward wrote:
On 12/10/2020 06:13, Carlos E. R. wrote:
And Linux does not allow me to copy files that contain ":" in their names, just a fact. I don't know what the wikipedia says, the problem is what Linux will allow me to write. I tried several programs, all of them fail with strange errors similar to the one I quoted by hand.
Well the shell does.
Not when the destination is an exfat filesystem. Try it. Remember the context ;-) cer@Telcontar:~/tmp/convmv> touch "file:name" cer@Telcontar:~/tmp/convmv> cp "file:name" /media/ssd250/ cp: cannot create regular file '/media/ssd250/file:name': No such file or directory cer@Telcontar:~/tmp/convmv> touch p cer@Telcontar:~/tmp/convmv> cp p /media/ssd250/ cer@Telcontar:~/tmp/convmv> cer@Telcontar:~/tmp/convmv> mount | grep ssd250 /dev/sdg1 on /media/ssd250 type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2) cer@Telcontar:~/tmp/convmv> -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 12/10/2020 08:30, Carlos E. R. wrote:
Not when the destination is an exfat filesystem. Try it.
And here I was understanding that the source was being manipulated on a Linux box and when the manipulation was complete was to be copied in DOS form to the exfat drive. But this make me wonder... Microsoft claims to be running a ubuntu-derived form of Linux on Windows. Won't there be a conflict, incongruity, there? -- “Reality is so complex, we must move away from dogma, whether it’s conspiracy theories or free-market,” -- James Glattfelder. http://jth.ch/jbg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2020-10-12 8:43 a.m., Anton Aylward wrote:
But this make me wonder... Microsoft claims to be running a ubuntu-derived form of Linux on Windows. Won't there be a conflict, incongruity, there?
With WSL2, it's the actual Linux kernel. It's also more than just Ubuntu. I have openSUSE Leap installed. I believe there is also support for the Linux file systems. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 14.43, Anton Aylward wrote:
On 12/10/2020 08:30, Carlos E. R. wrote:
Not when the destination is an exfat filesystem. Try it.
And here I was understanding that the source was being manipulated on a Linux box and when the manipulation was complete was to be copied in DOS form to the exfat drive.
No, I said manipulate and copy on the fly. It is on my first post.
But this make me wonder... Microsoft claims to be running a ubuntu-derived form of Linux on Windows. Won't there be a conflict, incongruity, there?
Maybe. But there is no way they can allow the ":" in a filename. The filesystem itself may support it, I don't see why not; but Windows (or MsDOS) would choke to death if it finds it. The colon delimits the "drive:" part of the path. They don't have the concept of "mounting". -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Anton Aylward wrote:
But this make me wonder... Microsoft claims to be running a ubuntu-derived form of Linux on Windows.
They do, the Windows Subsystem for Linux works very well and comes with Ubuntu by default. In school, my son's been using it quite a lot. Microsoft's Hyper-V also works very well for running openSUSE. -- Per Jessen, Zürich (10.2°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2020-10-12 9:34 a.m., Per Jessen wrote:
They do, the Windows Subsystem for Linux works very well and comes with Ubuntu by default. In school, my son's been using it quite a lot. Microsoft's Hyper-V also works very well for running openSUSE.
I believe Ubuntu was the only choice when WSL first came out, but now you have a few to choose from. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
I do not think Ububtu is the default. There is no default. After enabling WSL, you must install an OS from the Windows store. I have been happily using openSUSE. Odd to update it with zypper when really running it on a Windows computer. But it really works great. Note that there is also a much improved Windows terminal that has tabs. So you can have one with the dread cmd.exe, one with PowerShell (as if...) and one with, say openSUSE. On Mon, Oct 12, 2020 at 3:38 PM James Knott <james.knott@jknott.net> wrote:
On 2020-10-12 9:34 a.m., Per Jessen wrote:
They do, the Windows Subsystem for Linux works very well and comes with Ubuntu by default. In school, my son's been using it quite a lot. Microsoft's Hyper-V also works very well for running openSUSE.
I believe Ubuntu was the only choice when WSL first came out, but now you have a few to choose from.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Am 2020-10-20 11:06, schrieb Roger Oberholtzer:
Note that there is also a much improved Windows terminal that has tabs.
Link please. Is it in the "windows app store"? Cheers Mathias -- Mathias Homann Mathias.Homann@openSUSE.org telegram: https://telegram.me/lemmy98 irc: [lemmy] on freenode and ircnet obs: lemmy04 gpg key fingerprint: 8029 2240 F4DD 7776 E7D2 C042 6B8E 029E 13F2 C102
On Tue, Oct 20, 2020 at 12:16 PM Mathias Homann <Mathias.Homann@opensuse.org> wrote:
Am 2020-10-20 11:06, schrieb Roger Oberholtzer:
Note that there is also a much improved Windows terminal that has tabs.
Link please. Is it in the "windows app store"?
I assume it is https://docs.microsoft.com/en-us/windows/terminal/ It is available from App Store or github. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Tue, Oct 20, 2020 at 11:32 AM Andrei Borzenkov <arvidjaar@gmail.com> wrote:
I assume it is https://docs.microsoft.com/en-us/windows/terminal/
It is available from App Store or github.
That's the one. Source on Github. But I installed it from the store. -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 10/20/20 4:06 AM, Roger Oberholtzer wrote:
I do not think Ububtu is the default.
When the "Anniversary Edition" was released, (Win10 Build 1607?) and WSL was first introduced -- Ubuntu was all there was. Soon after many other distros followed suit. Now you can get just about any one you like. -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Mon, 12 Oct 2020 12:13:53 +0200 (CEST) "Carlos E. R." <robin.listas@telefonica.net> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Monday, 2020-10-12 at 10:59 +0100, Dave Howorth wrote:
On Mon, 12 Oct 2020 02:19:36 +0200 (CEST) "Carlos E. R." <> wrote:
El 2020-10-11 a las 22:27 +0100, Dave Howorth escribió:
On Sun, 11 Oct 2020 23:08:16 +0200 (CEST) "Carlos E. R." <> wrote:
I have to copy some files from Linux to external media formatted as exfat. Some names have a colon, like:
"chapter: 1"
Several programs baulk saying "can not create file, no such file or directory".
Is there some file browser that will "sanitize" names on the fly?
"chapter_ 1"
According to https://en.wikipedia.org/wiki/ExFAT
"Allowed characters in filenames all Unicode characters except U+0000 (NUL) through U+001F (US) / (slash) \ (backslash) : (colon) * (asterisk) ? (question mark) " (quote) < (less than) > (greater than) and | (pipe) (encoding in UTF-16LE)"
So unless the article is wrong, you need to find a program that behaves properly :)
No, you got it wrong. The ":" is perfectly valid in Linux filenames, but it is not in MsDOS Windows filenames.
You said an exfat filesystem. I quoted the rules for exfat. Now you're changing the target. MSDOS is very restrictive as a target.
Sorry, we are not understanding one another. Yes, the destination is exfat, which is an MsDOS/Windows filesystem. Or perhaps only Windows. Shall we say a Microsoft filesystem?
And Linux does not allow me to copy files that contain ":" in their names, just a fact. I don't know what the wikipedia says, the problem is what Linux will allow me to write. I tried several programs, all of them fail with strange errors similar to the one I quoted by hand.
The ":" is interpreted as a "drive" separator.
Nonsense, cp copies them just fine. You do have to quote the names of course. Linux doesn't have the concept of a single-letter 'drive' name. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 21.48, Dave Howorth wrote:
On Mon, 12 Oct 2020 12:13:53 +0200 (CEST) "Carlos E. R." <> wrote:
On Monday, 2020-10-12 at 10:59 +0100, Dave Howorth wrote:
On Mon, 12 Oct 2020 02:19:36 +0200 (CEST) "Carlos E. R." <> wrote:
El 2020-10-11 a las 22:27 +0100, Dave Howorth escribió:
On Sun, 11 Oct 2020 23:08:16 +0200 (CEST) "Carlos E. R." <> wrote:
According to https://en.wikipedia.org/wiki/ExFAT
"Allowed characters in filenames all Unicode characters except U+0000 (NUL) through U+001F (US) / (slash) \ (backslash) : (colon) * (asterisk) ? (question mark) " (quote) < (less than) > (greater than) and | (pipe) (encoding in UTF-16LE)"
So unless the article is wrong, you need to find a program that behaves properly :)
No, you got it wrong. The ":" is perfectly valid in Linux filenames, but it is not in MsDOS Windows filenames.
You said an exfat filesystem. I quoted the rules for exfat. Now you're changing the target. MSDOS is very restrictive as a target.
Sorry, we are not understanding one another. Yes, the destination is exfat, which is an MsDOS/Windows filesystem. Or perhaps only Windows. Shall we say a Microsoft filesystem?
And Linux does not allow me to copy files that contain ":" in their names, just a fact. I don't know what the wikipedia says, the problem is what Linux will allow me to write. I tried several programs, all of them fail with strange errors similar to the one I quoted by hand.
The ":" is interpreted as a "drive" separator.
Nonsense, cp copies them just fine. You do have to quote the names of course. Linux doesn't have the concept of a single-letter 'drive' name.
You go try it yourself. Create external media formatted as "exfat" and you try to create, for instance: touch "drive: noname" it just fails. Just try it. I have tried enough. I know it doesn't work, I have known for decades. cer@Telcontar:~> cd /media/ssd250/ cer@Telcontar:/media/ssd250> touch "chapter: one" touch: cannot touch 'chapter: one': No such file or directory cer@Telcontar:/media/ssd250> touch "chapter\: one" touch: cannot touch 'chapter\: one': No such file or directory cer@Telcontar:/media/ssd250> cer@Telcontar:/media/ssd250> mount | grep ssd250 /dev/sdg1 on /media/ssd250 type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2) cer@Telcontar:/media/ssd250> localhost:~ # fsck /dev/sdg1 fsck from util-linux 2.33.1 exfatfsck 1.2.8 Checking file system on /dev/sdg1. File system version 1.0 Sector size 512 bytes Cluster size 128 KB Volume size 233 GB Used space 75 GB Available space 158 GB Totally 12 directories and 128 files. File system checking finished. No errors found. localhost:~ # -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Dave Howorth wrote:
"Carlos E. R." <robin.listas@telefonica.net> wrote:
And Linux does not allow me to copy files that contain ":" in their names, just a fact. I don't know what the wikipedia says, the problem is what Linux will allow me to write. I tried several programs, all of them fail with strange errors similar to the one I quoted by hand.
The ":" is interpreted as a "drive" separator.
Nonsense, cp copies them just fine. You do have to quote the names of course. Linux doesn't have the concept of a single-letter 'drive' name.
Maybe you guys are getting hung up on terminology ? Carlos writes "Linux does not allow me to copy files that contain ":" in their names .... the problem is what Linux will allow me to write.". Taken literally, that is not correct. As Dave writes - 'cp' will copy such files just fine, the limitation is not in 'cp' nor in Linux, but in the receiving filesystem (something-FAT) which does not permit filenames containing ':'. Trying to do an open("drive: noname",...) will return EINVAL if the filesystem does not support that name. -- Per Jessen, Zürich (7.4°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 13/10/2020 09.59, Per Jessen wrote:
Dave Howorth wrote:
"Carlos E. R." <> wrote:
And Linux does not allow me to copy files that contain ":" in their names, just a fact. I don't know what the wikipedia says, the problem is what Linux will allow me to write. I tried several programs, all of them fail with strange errors similar to the one I quoted by hand.
The ":" is interpreted as a "drive" separator.
Nonsense, cp copies them just fine. You do have to quote the names of course. Linux doesn't have the concept of a single-letter 'drive' name.
Maybe you guys are getting hung up on terminology ?
Carlos writes "Linux does not allow me to copy files that contain ":" in their names .... the problem is what Linux will allow me to write.".
Taken literally, that is not correct.
Well, the "cp" program fails when attempting so. That's my meaning.
As Dave writes - 'cp' will copy such files just fine, the limitation is not in 'cp' nor in Linux, but in the receiving filesystem (something-FAT) which does not permit filenames containing ':'.
Trying to do an open("drive: noname",...) will return EINVAL if the filesystem does not support that name.
Yes, that is so. exfat destination does not accept that file. Theoretically, I see no reason why exfat would not allow to create such a file if the operating system is Linux, but it would break compatibility when connecting that disk to a Windows system. Thus, apparently the exfat driver creators decided to make it fail in Linux, too. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Le 11/10/2020 à 23:08, Carlos E. R. a écrit :
Is there some file browser that will "sanitize" names on the fly?
detox will sanitize file names, but rsync copy any file with any name, given a correct syntax (better not give any file name, only folder name) jdd -- http://dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El 2020-10-11 a las 23:28 +0200, jdd@dodin.org escribió:
Le 11/10/2020 à 23:08, Carlos E. R. a écrit :
Is there some file browser that will "sanitize" names on the fly?
detox will sanitize file names, but rsync copy any file with any name, given a correct syntax (better not give any file name, only folder name)
Mind, I want a program that: copies path/"A: name" to another_path/"A_ name" I do not want to change the files on the source dir. I want a file copy program that sanitizes names only on the destination. So I tell this program to do: copies path/"A: name" to another_path/"A: name" and instead does automatically copies path/"A: name" to another_path/"A_ name" - -- Cheers Carlos E. R. (from openSUSE 15.1 (Legolas)) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCX4OjGxwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVgx0An0ggDE101xAfidf8kjiP N6NH/u4UAJ9J1zAYGQgxlP4+lpz82Izn8f2Gtw== =NKDN -----END PGP SIGNATURE-----
Op maandag 12 oktober 2020 02:28:11 CEST schreef Carlos E. R.:
El 2020-10-11 a las 23:28 +0200, jdd@dodin.org escribió:
Le 11/10/2020 à 23:08, Carlos E. R. a écrit :
Is there some file browser that will "sanitize" names on the fly?
detox will sanitize file names, but rsync copy any file with any name, given a correct syntax (better not give any file name, only folder name) Mind, I want a program that:
copies path/"A: name" to another_path/"A_ name"
I do not want to change the files on the source dir. I want a file copy program that sanitizes names only on the destination.
So I tell this program to do:
copies path/"A: name" to another_path/"A: name"
and instead does automatically
copies path/"A: name" to another_path/"A_ name"
-- Cheers Carlos E. R.
(from openSUSE 15.1 (Legolas)) Why not write a simple script? OTOH, IIRC krename can create copies.
-- Gertjan Lettink a.k.a. Knurpht openSUSE Forums Team -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El 2020-10-12 a las 02:35 +0200, Knurpht-openSUSE escribió:
Op maandag 12 oktober 2020 02:28:11 CEST schreef Carlos E. R.:
Why not write a simple script?
I was trying to avoid that, surely I'm not the first one to hit this problem :-) Huh. Idea. Not a script, but an addition to midnight commander. That could be the best thing, if I manage to do it... I mean, on mc I can select the bunch of files to copy, from to, and use perhaps detox to sanitize the names. I wonder if some site has a collection of such scripts for mc, to pick your own?
OTOH, IIRC krename can create copies.
As I wrote the email I had the feeling I had seen that krename had an option to create a copy instead of renaming, yes. I was not sure. - -- Cheers Carlos E. R. (from openSUSE 15.1 (Legolas)) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCX4Ow/Bwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfViboAn3ErsMmrNWTqBWzyJkoR EvlH4OIZAJ4zSzxbAABTMYDhbU5IpXa0UdWavg== =hT3B -----END PGP SIGNATURE-----
Op maandag 12 oktober 2020 03:27:24 CEST schreef Carlos E. R.:
El 2020-10-12 a las 02:35 +0200, Knurpht-openSUSE escribió:
Op maandag 12 oktober 2020 02:28:11 CEST schreef Carlos E. R.:
Why not write a simple script?
I was trying to avoid that, surely I'm not the first one to hit this problem :-)
Huh. Idea. Not a script, but an addition to midnight commander. That could be the best thing, if I manage to do it... I mean, on mc I can select the bunch of files to copy, from to, and use perhaps detox to sanitize the names.
I wonder if some site has a collection of such scripts for mc, to pick your own?
OTOH, IIRC krename can create copies.
As I wrote the email I had the feeling I had seen that krename had an option to create a copy instead of renaming, yes. I was not sure.
Then why not check that first? You mentioned krename yourself already.
-- Cheers Carlos E. R.
(from openSUSE 15.1 (Legolas))
-- Gertjan Lettink a.k.a. Knurpht openSUSE Forums Team -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El 2020-10-12 a las 03:30 +0200, Knurpht-openSUSE escribió:
Op maandag 12 oktober 2020 03:27:24 CEST schreef Carlos E. R.:
El 2020-10-12 a las 02:35 +0200, Knurpht-openSUSE escribió:
Op maandag 12 oktober 2020 02:28:11 CEST schreef Carlos E. R.:
OTOH, IIRC krename can create copies.
As I wrote the email I had the feeling I had seen that krename had an option to create a copy instead of renaming, yes. I was not sure.
Then why not check that first? You mentioned krename yourself already.
I was not sure, and I'm not happy with that program, somehow. If I can concoct the mc script I would be much happier :-) - -- Cheers Carlos E. R. (from openSUSE 15.1 (Legolas)) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCX4Oyahwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVR7UAn0rXgsj+SvJMxWInMARl 6l3P5DAqAJ9YeaBLQ16MSgJGShuF+sXUQhPnMg== =m7Sp -----END PGP SIGNATURE-----
On 11/10/2020 21:27, Carlos E. R. wrote:
I wonder if some site has a collection of such scripts for mc, to pick your own?
Oh, gee, this is a pretty straight forward shell loop script. hint: newname=$(echo "$oldname" | tr ":" "_") mv "$oldname" newname I leave the outer loop (which might use 'ls' or might use 'find') as an exercise for the OP. I don't bother 'collecting' or arching such trivial "use one and throw away cos it's easy enough to rewrite them if I need to" scripts. Oh, and you can get rid of embedded spaces in file names the same way. But DO pay attention to quoting! -- “Reality is so complex, we must move away from dogma, whether it’s conspiracy theories or free-market,” -- James Glattfelder. http://jth.ch/jbg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 04.42, Anton Aylward wrote:
On 11/10/2020 21:27, Carlos E. R. wrote:
I wonder if some site has a collection of such scripts for mc, to pick your own?
Oh, gee, this is a pretty straight forward shell loop script.
hint: newname=$(echo "$oldname" | tr ":" "_") mv "$oldname" newname
Why mv and not cp?
I leave the outer loop (which might use 'ls' or might use 'find') as an exercise for the OP.
mc
I don't bother 'collecting' or arching such trivial "use one and throw away cos it's easy enough to rewrite them if I need to" scripts.
Oh, and you can get rid of embedded spaces in file names the same way. But DO pay attention to quoting!
yeah. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 12/10/2020 11.08, Carlos E. R. wrote:
On 12/10/2020 04.42, Anton Aylward wrote:
On 11/10/2020 21:27, Carlos E. R. wrote:
I leave the outer loop (which might use 'ls' or might use 'find') as an exercise for the OP.
mc
mc user menu script: + ! t t F2 Copy current file to dest sanitizing for fat - not finished #%f comes as 'Hola:\ ¿eres\ tu\?', so no quoting needed newname=$(echo %f | tr ":?" "__") if [ -e %D/"$newname" ]; then play -q /usr/share/sounds/au/beep_kind_warning.au echo "Destination file '$newname' exists" else cp %f %D/"$newname" fi + t t F2 Copy tagged files to dest sanitizing for fat - not finished set %u while [ -n "$1" ]; do newname=$(echo "$1" | tr ":?" "__") if [ -e %D/"$newname" ]; then paplay /usr/share/sounds/au/beep_kind_warning.au echo "Destination file '$newname' exists" else cp "$1" %D/"$newname" fi shift done -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 12/10/2020 08:15, Carlos E. R. wrote:
mc user menu script:
WHY ? Why this obsession with 'mc'? Zypper info tells me isn't a 2.8M installed size. What's the executable? If it can run an external shell script then why bother with 'mc' at all', why not just run the shell script? The guts of your script, translating old name to new name by piping through 'tr', is the same as mine, but you have the massive 'mc' to generate the loop whereas I use the already in existence and being used shell. I don't understand this obsession with complex, heavyweight solutions to what are trivial matters. Are you guys afraid of shell *programs* as opposed to simple shell statements? Like I said, this might be done with a one-line shell script. There's a challenge for you. Keep it light. -- “Reality is so complex, we must move away from dogma, whether it’s conspiracy theories or free-market,” -- James Glattfelder. http://jth.ch/jbg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 14.30, Anton Aylward wrote:
On 12/10/2020 08:15, Carlos E. R. wrote:
mc user menu script:
WHY ? Why this obsession with 'mc'?
I told you, because I'm navigating my filesystem with mc already, since decades. Why this obsession with telling me to get out of mc to do the job?
Zypper info tells me isn't a 2.8M installed size. What's the executable?
If it can run an external shell script then why bother with 'mc' at all', why not just run the shell script?
Because I navigate to the directory and *mark* or *tag* the files I want to copy, and I simply tell it to run a user defined script (from a menu of scripts) on the tagged files.
The guts of your script, translating old name to new name by piping through 'tr', is the same as mine, but you have the massive 'mc' to generate the loop whereas I use the already in existence and being used shell.
I don't understand this obsession with complex, heavyweight solutions to what are trivial matters.
Are you guys afraid of shell *programs* as opposed to simple shell statements? Like I said, this might be done with a one-line shell script.
There's a challenge for you. Keep it light.
Mine is work to make it simple to use. :-p -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 12/10/2020 08:36, Carlos E.R. wrote:
On 12/10/2020 14.30, Anton Aylward wrote:
On 12/10/2020 08:15, Carlos E. R. wrote:
[much skipped]
Mine is work to make it simple to use. :-p
Ah. So to you 'simple to use' is the 'visual environment' of MC, aka GUI, even if its a text based one. That's what I love about GUIs: They make simple tasks easier, and complex tasks impossible. -- John William Chambless Have you read "In the beginning was the command line"? -- “Reality is so complex, we must move away from dogma, whether it’s conspiracy theories or free-market,” -- James Glattfelder. http://jth.ch/jbg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 14.58, Anton Aylward wrote:
On 12/10/2020 08:36, Carlos E.R. wrote:
On 12/10/2020 14.30, Anton Aylward wrote:
On 12/10/2020 08:15, Carlos E. R. wrote:
[much skipped]
Mine is work to make it simple to use. :-p
(notice that this is the mantra of many hackers ;-) )
Ah. So to you 'simple to use' is the 'visual environment' of MC, aka GUI, even if its a text based one.
I call it TUI :-) No, I use the best tool for the purpose :-) It is faster for me to use 'mc' to locate the correct directory, which can be deep and uses long descriptive names with spaces. Once there I can type the command right there in 'mc', or use some menu option (with keyboard shortcuts) to do whatever job, or exit to the terminal fully.
That's what I love about GUIs: They make simple tasks easier, and complex tasks impossible. -- John William Chambless
I agree, but this TUI file browser (which is an "orthodox file manager") is very fast and customizable. <https://en.wikipedia.org/wiki/File_manager#Orthodox_file_managers>
Have you read "In the beginning was the command line"?
Nope :-D -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 12/10/2020 14.30, Anton Aylward wrote:
On 12/10/2020 08:15, Carlos E. R. wrote:
mc user menu script:
WHY ? Why this obsession with 'mc'?
Zypper info tells me isn't a 2.8M installed size. What's the executable?
I install it even on my rescue sticks. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Am 12.10.20 um 14:15 schrieb Carlos E. R.:
On 12/10/2020 11.08, Carlos E. R. wrote:
On 12/10/2020 04.42, Anton Aylward wrote:
On 11/10/2020 21:27, Carlos E. R. wrote:
I leave the outer loop (which might use 'ls' or might use 'find') as an exercise for the OP.
mc
mc user menu script:
+ ! t t F2 Copy current file to dest sanitizing for fat - not finished #%f comes as 'Hola:\ ¿eres\ tu\?', so no quoting needed newname=$(echo %f | tr ":?" "__") if [ -e %D/"$newname" ]; then play -q /usr/share/sounds/au/beep_kind_warning.au echo "Destination file '$newname' exists" else cp %f %D/"$newname" fi
+ t t F2 Copy tagged files to dest sanitizing for fat - not finished set %u while [ -n "$1" ]; do newname=$(echo "$1" | tr ":?" "__") if [ -e %D/"$newname" ]; then paplay /usr/share/sounds/au/beep_kind_warning.au echo "Destination file '$newname' exists" else cp "$1" %D/"$newname" fi shift done
Hi calos, when your script is running fine, would be nice to share it here, i am interested in, i face this problems sometimes too, and i like also to do it with mc ;-)) simoN -- www.becherer.de -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 18.00, Simon Becherer wrote:
Am 12.10.20 um 14:15 schrieb Carlos E. R.:
mc user menu script:
+ ! t t F2 Copy current file to dest sanitizing for fat - not finished #%f comes as 'Hola:\ ¿eres\ tu\?', so no quoting needed newname=$(echo %f | tr ":?" "__") if [ -e %D/"$newname" ]; then play -q /usr/share/sounds/au/beep_kind_warning.au echo "Destination file '$newname' exists" else cp %f %D/"$newname" fi
+ t t F2 Copy tagged files to dest sanitizing for fat - not finished set %u while [ -n "$1" ]; do newname=$(echo "$1" | tr ":?" "__") if [ -e %D/"$newname" ]; then paplay /usr/share/sounds/au/beep_kind_warning.au echo "Destination file '$newname' exists" else cp "$1" %D/"$newname" fi shift done
Hi calos,
when your script is running fine, would be nice to share it here, i am interested in, i face this problems sometimes too, and i like also to do it with mc ;-))
Well, the above is running "fine" ;-) I mean, it changes the two characters I have hit so far. There may be more, but I have not hit them yet. The "play sound on error" thing doesn't work well on the first error, I have no idea why. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 12/10/2020 05:08, Carlos E. R. wrote:
On 12/10/2020 04.42, Anton Aylward wrote:
On 11/10/2020 21:27, Carlos E. R. wrote:
I wonder if some site has a collection of such scripts for mc, to pick your own?
Oh, gee, this is a pretty straight forward shell loop script.
hint: newname=$(echo "$oldname" | tr ":" "_") mv "$oldname" newname
Why mv and not cp?
sure, why not.
I leave the outer loop (which might use 'ls' or might use 'find') as an exercise for the OP.
mc
makes no sense to use something that heavyweight when a trivial for each oldname in ..... will suffice. If you really want, you might be able to do it with a single line of shell. And don't forget that shell can do some sophisticated pattern matching and eliding. -- “Reality is so complex, we must move away from dogma, whether it’s conspiracy theories or free-market,” -- James Glattfelder. http://jth.ch/jbg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 14.18, Anton Aylward wrote:
On 12/10/2020 05:08, Carlos E. R. wrote:
On 12/10/2020 04.42, Anton Aylward wrote:
On 11/10/2020 21:27, Carlos E. R. wrote:
I wonder if some site has a collection of such scripts for mc, to pick your own?
Oh, gee, this is a pretty straight forward shell loop script.
hint: newname=$(echo "$oldname" | tr ":" "_") mv "$oldname" newname
Why mv and not cp?
sure, why not.
Yeah, but I meant why did you use 'mv' when I said I wanted to copy files.
I leave the outer loop (which might use 'ls' or might use 'find') as an exercise for the OP.
mc
makes no sense to use something that heavyweight when a trivial
for each oldname in .....
will suffice.
On the contrary, I was using 'mc' when I hit this problem. I'm simply adding a feature to my 'mc' so that it copes with this situation.
If you really want, you might be able to do it with a single line of shell. And don't forget that shell can do some sophisticated pattern matching and eliding.
I prefer navigating and selecting the files with a file browser, and 'mc' is the one I use 95% of times. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 12/10/2020 04.42, Anton Aylward wrote:
On 11/10/2020 21:27, Carlos E. R. wrote:
I wonder if some site has a collection of such scripts for mc, to pick your own?
Oh, gee, this is a pretty straight forward shell loop script.
hint: newname=$(echo "$oldname" | tr ":" "_") mv "$oldname" newname
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "__" Hola_ ¿eres tú_ cer@Telcontar:~> That's perfect. But: cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~> That one is not perfect. Why "�" when I said "¿"? I found an interesting function, but I do not understand how it works. Original: <https://odoepner.wordpress.com/2011/10/13/bash-script-to-recursively-sanitize-folder-and-file-names/> So I created a test script for my case: +++............. #!/bin/bash shopt -s extglob; filename=$(basename "$1") directory=$(dirname "$1") filename_clean="${filename//+([^[:alnum:]_-\.])/_}" echo $filename_clean .............++- So I have a sample file: cer@Telcontar:~/tmp/convmv> l total 20 drwxr-xr-x 2 cer users 63 Oct 12 11:34 ./ drwxr-xr-x 126 cer users 8192 Oct 12 11:21 ../ -rw-r--r-- 1 cer users 0 Oct 12 11:22 Hola: ¿eres tu? -rwxr-xr-x 1 cer users 158 Oct 12 11:34 sanitize* -rwxr-xr-x 1 cer users 139 Oct 12 11:33 sanitize~* cer@Telcontar:~/tmp/convmv> I run the script: cer@Telcontar:~/tmp/convmv> ./sanitize "Hola: ¿eres tu?" Hola_eres_tu_ cer@Telcontar:~/tmp/convmv> It is eating the spaces, I do not want that. But I can not change it because I do not understand how it works. Just curious, because the tr concoction seems much easier to control -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Carlos E. R. wrote:
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~>
That one is not perfect. Why "�" when I said "¿"?
'tr' doesn't do multi-byte characters, such as UTF-8.
It is eating the spaces, I do not want that. But I can not change it because I do not understand how it works.
filename_clean="${filename//+([^[:alnum:]_-\.])/_}" [^[:alnum:]_-\.] includes spaces. It says "take any character that is not 'alnum' or underscore, hyphen or period" and replace with '_'. -- Per Jessen, Zürich (9.1°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 12.17, Per Jessen wrote:
Carlos E. R. wrote:
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~>
That one is not perfect. Why "�" when I said "¿"?
'tr' doesn't do multi-byte characters, such as UTF-8.
But "¿" is old school, single char: man latin1: Oct Dec Hex Char Description 277 191 BF ¿ INVERTED QUESTION MARK
It is eating the spaces, I do not want that. But I can not change it because I do not understand how it works.
filename_clean="${filename//+([^[:alnum:]_-\.])/_}"
[^[:alnum:]_-\.] includes spaces. It says "take any character that is not 'alnum' or underscore, hyphen or period" and replace with '_'.
ah, alfanumerics. I see. Then I'll drop that idea. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Carlos E. R. wrote:
On 12/10/2020 12.17, Per Jessen wrote:
Carlos E. R. wrote:
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~>
That one is not perfect. Why "�" when I said "¿"?
'tr' doesn't do multi-byte characters, such as UTF-8.
But "¿" is old school, single char:
Yes, but your shell is probably in UTF-8, where '¿' = 0xc2bf. -- Per Jessen, Zürich (10.1°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 13.20, Per Jessen wrote:
Carlos E. R. wrote:
On 12/10/2020 12.17, Per Jessen wrote:
Carlos E. R. wrote:
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~>
That one is not perfect. Why "�" when I said "¿"?
'tr' doesn't do multi-byte characters, such as UTF-8.
But "¿" is old school, single char:
Yes, but your shell is probably in UTF-8, where '¿' = 0xc2bf.
Yeah, it figures. :-( Do you know a tr alternative that supports multibyte char? -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Carlos E. R. wrote:
Yes, but your shell is probably in UTF-8, where '¿' = 0xc2bf.
Yeah, it figures. :-(
Do you know a tr alternative that supports multibyte char?
sed and awk are the obvious candicates, I think(!) they both support utf8. -- Per Jessen, Zürich (10.4°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 15.26, Per Jessen wrote:
Carlos E. R. wrote:
Yes, but your shell is probably in UTF-8, where '¿' = 0xc2bf.
Yeah, it figures. :-(
Do you know a tr alternative that supports multibyte char?
sed and awk are the obvious candicates, I think(!) they both support utf8.
huh. Not direct replacements, then. I'm afraid I choke on the syntax of those both. If I have to do it, I would do it in Pascal. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 12/10/2020 07:33, Carlos E. R. wrote:
On 12/10/2020 13.20, Per Jessen wrote:
Carlos E. R. wrote:
On 12/10/2020 12.17, Per Jessen wrote:
Carlos E. R. wrote:
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~>
That one is not perfect. Why "�" when I said "¿"?
'tr' doesn't do multi-byte characters, such as UTF-8.
But "¿" is old school, single char:
Yes, but your shell is probably in UTF-8, where '¿' = 0xc2bf.
Yeah, it figures. :-(
Do you know a tr alternative that supports multibyte char?
I was under the impression that the shell could handle multibyte chars. Perhaps it has to do with you locale/environment setting. Try again with the environment set to export LANG=C.UTF-8 Then again, it may be that your terminal emulator isn't in UTF-8 and it treating "¿" as a single character and not as UTF-8. Therein might be the conflict. See also the man pages "tr(1)" and "tr(1p)" In particular the latter. -- “Reality is so complex, we must move away from dogma, whether it’s conspiracy theories or free-market,” -- James Glattfelder. http://jth.ch/jbg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 15.29, Anton Aylward wrote:
On 12/10/2020 07:33, Carlos E. R. wrote:
On 12/10/2020 13.20, Per Jessen wrote:
Carlos E. R. wrote:
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~>
That one is not perfect. Why "�" when I said "¿"?
'tr' doesn't do multi-byte characters, such as UTF-8.
But "¿" is old school, single char:
Yes, but your shell is probably in UTF-8, where '¿' = 0xc2bf.
Yeah, it figures. :-(
Do you know a tr alternative that supports multibyte char?
I was under the impression that the shell could handle multibyte chars. Perhaps it has to do with you locale/environment setting. Try again with the environment set to export LANG=C.UTF-8
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~> LANG=C.UTF-8 echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~>
Then again, it may be that your terminal emulator isn't in UTF-8 and it treating "¿" as a single character and not as UTF-8. Therein might be the conflict.
Impossible. It is XFCE terminal. Tried xterm, gnome terminal and konsole, same issue.
See also the man pages "tr(1)" and "tr(1p)" In particular the latter.
multi-char are excluded. I don't see any other thing that is interesting on a quick look. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 12/10/2020 09:39, Carlos E.R. wrote:
On 12/10/2020 15.29, Anton Aylward wrote:
On 12/10/2020 07:33, Carlos E. R. wrote:
On 12/10/2020 13.20, Per Jessen wrote:
Carlos E. R. wrote:
> cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" > Hola_ ¿eres tú� > cer@Telcontar:~> > > That one is not perfect. Why "�" when I said "¿"?
'tr' doesn't do multi-byte characters, such as UTF-8.
But "¿" is old school, single char:
Yes, but your shell is probably in UTF-8, where '¿' = 0xc2bf.
Yeah, it figures. :-(
Do you know a tr alternative that supports multibyte char?
I was under the impression that the shell could handle multibyte chars. Perhaps it has to do with you locale/environment setting. Try again with the environment set to export LANG=C.UTF-8
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~> LANG=C.UTF-8 echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~>
That's might be more meaningful if you did echo $LANG at the beginning. anton@main:~> echo $LANG en_CA.UTF-8
Then again, it may be that your terminal emulator isn't in UTF-8 and it treating "¿" as a single character and not as UTF-8. Therein might be the conflict.
Impossible. It is XFCE terminal. Tried xterm, gnome terminal and konsole, same issue.
See above.
See also the man pages "tr(1)" and "tr(1p)" In particular the latter.
multi-char are excluded. I don't see any other thing that is interesting on a quick look.
The "tr(1p)" discusses both the environment variables and the character classes in more detail. Both are relevant to this thread. -- “Reality is so complex, we must move away from dogma, whether it’s conspiracy theories or free-market,” -- James Glattfelder. http://jth.ch/jbg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 16.29, Anton Aylward wrote:
On 12/10/2020 09:39, Carlos E.R. wrote:
On 12/10/2020 15.29, Anton Aylward wrote:
On 12/10/2020 07:33, Carlos E. R. wrote:
On 12/10/2020 13.20, Per Jessen wrote:
Carlos E. R. wrote:
>> cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" >> Hola_ ¿eres tú� >> cer@Telcontar:~> >> >> That one is not perfect. Why "�" when I said "¿"? > > 'tr' doesn't do multi-byte characters, such as UTF-8.
But "¿" is old school, single char:
Yes, but your shell is probably in UTF-8, where '¿' = 0xc2bf.
Yeah, it figures. :-(
Do you know a tr alternative that supports multibyte char?
I was under the impression that the shell could handle multibyte chars. Perhaps it has to do with you locale/environment setting. Try again with the environment set to export LANG=C.UTF-8
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~> LANG=C.UTF-8 echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~>
That's might be more meaningful if you did echo $LANG at the beginning.
If you insist. cer@Telcontar:~/tmp/convmv> echo $LANG en_US.UTF-8 cer@Telcontar:~/tmp/convmv>
anton@main:~> echo $LANG en_CA.UTF-8
Then again, it may be that your terminal emulator isn't in UTF-8 and it treating "¿" as a single character and not as UTF-8. Therein might be the conflict.
Impossible. It is XFCE terminal. Tried xterm, gnome terminal and konsole, same issue.
See above.
See above...
See also the man pages "tr(1)" and "tr(1p)" In particular the latter.
multi-char are excluded. I don't see any other thing that is interesting on a quick look.
The "tr(1p)" discusses both the environment variables and the character classes in more detail. Both are relevant to this thread.
Sorry, but I did not see what might be. The string "utf" is not present. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 12/10/2020 12:39, Carlos E. R. wrote:
On 12/10/2020 16.29, Anton Aylward wrote:
On 12/10/2020 09:39, Carlos E.R. wrote:
On 12/10/2020 15.29, Anton Aylward wrote:
On 12/10/2020 07:33, Carlos E. R. wrote:
On 12/10/2020 13.20, Per Jessen wrote:
Carlos E. R. wrote:
>>> cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" >>> Hola_ ¿eres tú� >>> cer@Telcontar:~> >>> >>> That one is not perfect. Why "�" when I said "¿"? >> >> 'tr' doesn't do multi-byte characters, such as UTF-8. > > But "¿" is old school, single char: >
Yes, but your shell is probably in UTF-8, where '¿' = 0xc2bf.
Yeah, it figures. :-(
Do you know a tr alternative that supports multibyte char?
I was under the impression that the shell could handle multibyte chars. Perhaps it has to do with you locale/environment setting. Try again with the environment set to export LANG=C.UTF-8
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~> LANG=C.UTF-8 echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~>
That's might be more meaningful if you did echo $LANG at the beginning.
If you insist.
cer@Telcontar:~/tmp/convmv> echo $LANG en_US.UTF-8 cer@Telcontar:~/tmp/convmv>
Indeed. It being the UTF-8 part that makes it so. -- “Reality is so complex, we must move away from dogma, whether it’s conspiracy theories or free-market,” -- James Glattfelder. http://jth.ch/jbg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 13/10/2020 01.07, Anton Aylward wrote:
On 12/10/2020 12:39, Carlos E. R. wrote:
On 12/10/2020 16.29, Anton Aylward wrote:
On 12/10/2020 09:39, Carlos E.R. wrote:
On 12/10/2020 15.29, Anton Aylward wrote:
On 12/10/2020 07:33, Carlos E. R. wrote:
On 12/10/2020 13.20, Per Jessen wrote: > Carlos E. R. wrote:
>>>> cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" >>>> Hola_ ¿eres tú� >>>> cer@Telcontar:~> >>>> >>>> That one is not perfect. Why "�" when I said "¿"? >>> >>> 'tr' doesn't do multi-byte characters, such as UTF-8. >> >> But "¿" is old school, single char: >> > > Yes, but your shell is probably in UTF-8, where '¿' = 0xc2bf.
Yeah, it figures. :-(
Do you know a tr alternative that supports multibyte char?
I was under the impression that the shell could handle multibyte chars. Perhaps it has to do with you locale/environment setting. Try again with the environment set to export LANG=C.UTF-8
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~> LANG=C.UTF-8 echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~>
That's might be more meaningful if you did echo $LANG at the beginning.
If you insist.
cer@Telcontar:~/tmp/convmv> echo $LANG en_US.UTF-8 cer@Telcontar:~/tmp/convmv>
Indeed. It being the UTF-8 part that makes it so.
As you can see, my environment has been UTF8 all the time, and LANG whatever does not affect 'tr' accepting utf8 chars. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Hello, Am Montag, 12. Oktober 2020, 12:31:51 CEST schrieb Carlos E. R.:
On 12/10/2020 12.17, Per Jessen wrote:
Carlos E. R. wrote:
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~>
That one is not perfect. Why "�" when I said "¿"?
'tr' doesn't do multi-byte characters, such as UTF-8.
But "¿" is old school, single char:
man latin1:
Oct Dec Hex Char Description
277 191 BF ¿ INVERTED QUESTION MARK
In good old latin1, yes. But in utf8 (which you probably use nowadays) it's two bytes: echo -n '¿' |hexdump 0000000 bfc2 0000002 Regards, Christian Boltz -- log.debug "If you are interested, I am here, but you probably are not." log.info "JFYI: I am here" log.warn "Hey! I am here." log.error "I am here and you have problem." [Josef Reidinger in yast-devel] -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 23.02, Christian Boltz wrote:
Hello,
Am Montag, 12. Oktober 2020, 12:31:51 CEST schrieb Carlos E. R.:
On 12/10/2020 12.17, Per Jessen wrote:
Carlos E. R. wrote:
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~>
That one is not perfect. Why "�" when I said "¿"?
'tr' doesn't do multi-byte characters, such as UTF-8.
But "¿" is old school, single char:
man latin1:
Oct Dec Hex Char Description
277 191 BF ¿ INVERTED QUESTION MARK
In good old latin1, yes.
But in utf8 (which you probably use nowadays) it's two bytes:
echo -n '¿' |hexdump 0000000 bfc2 0000002
Ok... sigh. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 12/10/2020 17:02, Christian Boltz wrote:
Hello,
Am Montag, 12. Oktober 2020, 12:31:51 CEST schrieb Carlos E. R.:
On 12/10/2020 12.17, Per Jessen wrote:
Carlos E. R. wrote:
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~>
That one is not perfect. Why "�" when I said "¿"?
'tr' doesn't do multi-byte characters, such as UTF-8.
But "¿" is old school, single char:
man latin1:
Oct Dec Hex Char Description
277 191 BF ¿ INVERTED QUESTION MARK
In good old latin1, yes.
But in utf8 (which you probably use nowadays) it's two bytes:
echo -n '¿' |hexdump 0000000 bfc2 0000002
Context is Everything. Or in this case, the environment. Once again, that needs to be preceded by "echo $LANG" to clarify context in which this is true. <sidebar> I'm curious to see if a step-and-repeat though a variety of language with 'UTF-8" appended all return the same. One could, I suppose, open up the character maps and overlap and see if that this is the same in all of them </sidebar> -- “Reality is so complex, we must move away from dogma, whether it’s conspiracy theories or free-market,” -- James Glattfelder. http://jth.ch/jbg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Anton Aylward wrote:
<sidebar> I'm curious to see if a step-and-repeat though a variety of language with 'UTF-8" appended all return the same. One could, I suppose, open up the character maps and overlap and see if that this is the same in all of them </sidebar>
There is surely little reason to think ¿ should have a different encoding in en_GB.utf89 and in de_DE.utf8 ? locale -a | grep utf8$ | \ while read l; do LC_ALL=$l echo -n '¿' | hexdump; done -- Per Jessen, Zürich (8.4°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 23.02, Christian Boltz wrote:
Hello,
Am Montag, 12. Oktober 2020, 12:31:51 CEST schrieb Carlos E. R.:
On 12/10/2020 12.17, Per Jessen wrote:
Carlos E. R. wrote:
cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr ":?" "_¿" Hola_ ¿eres tú� cer@Telcontar:~>
That one is not perfect. Why "�" when I said "¿"?
'tr' doesn't do multi-byte characters, such as UTF-8.
But "¿" is old school, single char:
man latin1:
Oct Dec Hex Char Description
277 191 BF ¿ INVERTED QUESTION MARK
In good old latin1, yes.
But in utf8 (which you probably use nowadays) it's two bytes:
echo -n '¿' |hexdump 0000000 bfc2 0000002
It appears that 'tr' accepts octal for definition of char sets (not hex). octal for bfc2 is "137702", so I tried: cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr "?" "\137702" Hola: ¿eres tú_ cer@Telcontar:~> which is not the char I want converted to. man 1p tr says \octal Octal sequences can be used to represent char- acters with specific coded values. An octal sequence shall consist of a <backslash> fol- lowed by the longest sequence of one, two, or three-octal-digit characters (01234567). The sequence shall cause the value whose encoding is represented by the one, two, or three-digit octal integer to be placed into the array. Multi-byte characters require multiple, con- catenated escape sequences of this type, including the leading <backslash> for each byte. Ah. Each byte starts with \ cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr "?:" "\191\302_" Hola9 ¿eres tú cer@Telcontar:~> Not working. But where does the octal char end? This does not work: cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr "?:" "\137702_" Hola7 ¿eres tú_ cer@Telcontar:~> Maybe the octal conversion is wrong? I recognize I'm not used to write in octal, so another try: man hexdump -b, --one-byte-octal One-byte octal display. Display the input offset in hexadecimal, followed by sixteen space-sepa- rated, three-column, zero-filled bytes of input data, in octal, per line. cer@Telcontar:~> echo -n '¿' |hexdump -b 0000000 302 277 0000002 cer@Telcontar:~> cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr "?" "\302\277" Hola: ¿eres tú� cer@Telcontar:~> Ah, that is the same error I got initially: cer@Telcontar:~> echo "Hola: ¿eres tú?" | tr "?" "¿" Hola: ¿eres tú� cer@Telcontar:~> So it is definite, 'tr' does not work with multibyte chars, despite them being mentioned in the manual. And this time, the LANG setting does not intervene, I'm using octal. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 2020-10-13, 07:41:19 CET Carlos E. R. wrote:
So it is definite, 'tr' does not work with multibyte chars, despite them being mentioned in the manual. And this time, the LANG setting does not intervene, I'm using octal.
Welp, my tr(1) says »Full documentation <https://www.gnu.org/software/coreutils/tr> or available locally via: info '(coreutils) tr invocation'« which says »Currently ‘tr’ fully supports only single-byte characters. Eventually it will support multibyte characters;« Regards mararm -- I can give you my word, but I know what it's worth and you don't. -- Nero Wolfe, "Over My Dead Body" -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 05:58, Carlos E. R. wrote:
It is eating the spaces, I do not want that. But I can not change it because I do not understand how it works.
It works by means of regular expressions. That's a built in to the shell and gets back to why the command line can do the selection so easily and so fast. This is essentially the one line 'outer loop. I was speaking of. The ([^[:alnum:]_-\.]) is saying the set ("[...]") of characters that consists of .. the set of alphanumerics - "[:alnum:]" which is shorthand for "[A-Za-z0-9]" plus "_", "-" and "." negated (meaning all except) The rest of that shell expression means 'substitute for'
Just curious, because the tr concoction seems much easier to control
And he, the same regular expression works for 'tr'. The point here is why excel an external program like 'tr' when the shell can do it internally? The shell can also do testing (man test) and arithmetic. That's what makes it a shell and not just a command line. it's a complete programming language. And a pretty powerful one at that! -- “Reality is so complex, we must move away from dogma, whether it’s conspiracy theories or free-market,” -- James Glattfelder. http://jth.ch/jbg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 15.15, Anton Aylward wrote:
On 12/10/2020 05:58, Carlos E. R. wrote:
It is eating the spaces, I do not want that. But I can not change it because I do not understand how it works.
It works by means of regular expressions. That's a built in to the shell and gets back to why the command line can do the selection so easily and so fast. This is essentially the one line 'outer loop. I was speaking of.
The ([^[:alnum:]_-\.])
is saying the set ("[...]") of characters that consists of .. the set of alphanumerics - "[:alnum:]" which is shorthand for "[A-Za-z0-9]" plus "_", "-" and "." negated (meaning all except)
It is too strict a concoction for me.
The rest of that shell expression means 'substitute for'
Just curious, because the tr concoction seems much easier to control
And he, the same regular expression works for 'tr'.
"he"?
The point here is why excel an external program like 'tr' when the shell can do it internally? The shell can also do testing (man test) and arithmetic.
That's what makes it a shell and not just a command line. it's a complete programming language. And a pretty powerful one at that!
mc can integrate full bash scripts ;-) The only difference is that it has macros, which are expanded before calling the script. Yes, mc writes the script to /tmp and then calls it. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 11/10/2020 21:27, Carlos E. R. wrote:
Why not write a simple script?
I was trying to avoid that, surely I'm not the first one to hit this problem :-)
Indeed, but the script is so simple as to be trivial and compared to using 'mc' or other offered "solutions" is lightweight. I write these sort of scripts all the time, simple shell loops, simple generators, simple bodies. All in all more time and effort has been spent discussing this than it takes to write that trivial shell loop for this. Stop trying to make things more complicated than they need to be. -- “Reality is so complex, we must move away from dogma, whether it’s conspiracy theories or free-market,” -- James Glattfelder. http://jth.ch/jbg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 04.47, Anton Aylward wrote:
On 11/10/2020 21:27, Carlos E. R. wrote:
Why not write a simple script?
I was trying to avoid that, surely I'm not the first one to hit this problem :-)
Indeed, but the script is so simple as to be trivial and compared to using 'mc' or other offered "solutions" is lightweight.
No, the purpose of using 'mc' is to point and click at the directory and files to be copied and to where.
I write these sort of scripts all the time, simple shell loops, simple generators, simple bodies.
All in all more time and effort has been spent discussing this than it takes to write that trivial shell loop for this. Stop trying to make things more complicated than they need to be.
Because I want a file manager to do it, not a command. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Le 12/10/2020 à 11:10, Carlos E. R. a écrit :
No, the purpose of using 'mc' is to point and click at the directory and files to be copied and to where.
man mcopy ? jdd -- http://dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday, 2020-10-12 at 12:06 +0200, jdd@dodin.org wrote:
Le 12/10/2020 à 11:10, Carlos E. R. a écrit :
No, the purpose of using 'mc' is to point and click at the directory and files to be copied and to where.
man mcopy
I had forgotten that one. Yes, that thing would do the entire operation in a single command: mcopy pm source dest and done. I don't remember if "-D" is needed. - -- Cheers, Carlos E. R. (from openSUSE 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCX4QuTRwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfV90gAn1ejkIULpb1DHPx4eOUV x14h+96mAJ0S9JfOIJabaA4rhgYq0gyLtu3H7w== =h62M -----END PGP SIGNATURE-----
Carlos E. R. wrote:
El 2020-10-12 a las 02:35 +0200, Knurpht-openSUSE escribió:
Op maandag 12 oktober 2020 02:28:11 CEST schreef Carlos E. R.:
Why not write a simple script?
I was trying to avoid that, surely I'm not the first one to hit this problem :-)
Maybe take a look at posixovl - https://sourceforge.net/projects/posixovl/ Although it will replace invalid chars with '%(xx)', not with an underscore. Easily fixed in the code if you want. To use this, you mount a VFAT filesystem with posixovl and you can now use your favourite copy incantation to copy files and have them automagically renamed. -- Per Jessen, Zürich (7.1°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 09.43, Per Jessen wrote:
Carlos E. R. wrote:
El 2020-10-12 a las 02:35 +0200, Knurpht-openSUSE escribió:
Op maandag 12 oktober 2020 02:28:11 CEST schreef Carlos E. R.:
Why not write a simple script?
I was trying to avoid that, surely I'm not the first one to hit this problem :-)
Maybe take a look at posixovl -
https://sourceforge.net/projects/posixovl/
Although it will replace invalid chars with '%(xx)', not with an underscore. Easily fixed in the code if you want.
What is '%(xx)', can you show an example? Or is that the actual chars?
To use this, you mount a VFAT filesystem with posixovl and you can now use your favourite copy incantation to copy files and have them automagically renamed.
Hum! However, the destination is not actually FAT, but exFAT. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 2020-10-12 11:14, Carlos E. R. wrote:
What is '%(xx)', can you show an example? Or is that the actual chars?
Row 778: * Encode all the special characters that are invalid to use on VFAT by * substituting each by "%(xx)", where xx is the textual hexadecimal * representation. Returns a pointer to an allocated memory block containing * the encoded result. ref. https://github.com/Tomas-M/posixovl/blob/master/posixovl.c -- /bengan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Carlos E. R. wrote:
On 12/10/2020 09.43, Per Jessen wrote:
Carlos E. R. wrote:
El 2020-10-12 a las 02:35 +0200, Knurpht-openSUSE escribió:
Op maandag 12 oktober 2020 02:28:11 CEST schreef Carlos E. R.:
Why not write a simple script?
I was trying to avoid that, surely I'm not the first one to hit this problem :-)
Maybe take a look at posixovl -
https://sourceforge.net/projects/posixovl/
Although it will replace invalid chars with '%(xx)', not with an underscore. Easily fixed in the code if you want.
What is '%(xx)', can you show an example? Or is that the actual chars?
It is the hex value of the invalid character, e.g. ':' becomes '%(3A)'.
To use this, you mount a VFAT filesystem with posixovl and you can now use your favourite copy incantation to copy files and have them automagically renamed.
Hum! However, the destination is not actually FAT, but exFAT.
It doesn't matter, unless exFAT has a different set of unacceptable characters. -- Per Jessen, Zürich (9.2°C) http://www.cloudsuisse.com/ - your owncloud, hosted in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 11.30, Per Jessen wrote:
Carlos E. R. wrote:
On 12/10/2020 09.43, Per Jessen wrote:
Carlos E. R. wrote:
El 2020-10-12 a las 02:35 +0200, Knurpht-openSUSE escribió:
Op maandag 12 oktober 2020 02:28:11 CEST schreef Carlos E. R.:
Why not write a simple script?
I was trying to avoid that, surely I'm not the first one to hit this problem :-)
Maybe take a look at posixovl -
https://sourceforge.net/projects/posixovl/
Although it will replace invalid chars with '%(xx)', not with an underscore. Easily fixed in the code if you want.
What is '%(xx)', can you show an example? Or is that the actual chars?
It is the hex value of the invalid character, e.g. ':' becomes '%(3A)'.
Yes. Thanks Bengt Gördén for his detailed answer :-)
To use this, you mount a VFAT filesystem with posixovl and you can now use your favourite copy incantation to copy files and have them automagically renamed.
Hum! However, the destination is not actually FAT, but exFAT.
It doesn't matter, unless exFAT has a different set of unacceptable characters.
It is also fuse. I don't suppose I can chain two fuses. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Carlos E. R. wrote:
Hum! However, the destination is not actually FAT, but exFAT.
It doesn't matter, unless exFAT has a different set of unacceptable characters.
It is also fuse. I don't suppose I can chain two fuses.
I don't see any reason why not. Try it. OTOH, by now I would gone with Anton's proposal :-) -- Per Jessen, Zürich (9.8°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday, 2020-10-12 at 12:07 +0200, Per Jessen wrote:
Carlos E. R. wrote:
Hum! However, the destination is not actually FAT, but exFAT.
It doesn't matter, unless exFAT has a different set of unacceptable characters.
It is also fuse. I don't suppose I can chain two fuses.
I don't see any reason why not. Try it. OTOH, by now I would gone with Anton's proposal :-)
Yes, I'm going with it, but creating an 'mc' script. Also, jdd idea of using "mcopy" is very interesting, because it is an old program designed to copy files to/from linux/dos. Just the tool, except that it is not point and click. - -- Cheers, Carlos E. R. (from openSUSE 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCX4Qu7Rwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfV/bwAoJcda7hAV/K+iLqXjDi3 Pehw9T1JAKCVXAPnWyHf9/o26YaE9FsM8x+ybA== =vN13 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Carlos, et al -- ...and then Carlos E. R. said... % % Mind, I want a program that: % % copies path/"A: name" to another_path/"A_ name" [snip] Have you checked out tar ... --transform=/:/_/ ... to replace the colon char, whether on create or on extract? I haven't checked to see if rsync has such an option, which would be excellent for continued sync if you aren't just looking for a one-time copy. YMMV Good luck! :-) :-D -- David T-G See http://justpickone.org/davidtg/email/ See http://justpickone.org/davidtg/tofu.txt -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 04.12, David T-G wrote:
Carlos, et al --
...and then Carlos E. R. said... % % Mind, I want a program that: % % copies path/"A: name" to another_path/"A_ name" [snip]
Have you checked out
tar ... --transform=/:/_/ ...
wow :-o
to replace the colon char, whether on create or on extract?
No, I haven't. I hadn't the foggiest idea about such a concoction :-D
I haven't checked to see if rsync has such an option, which would be excellent for continued sync if you aren't just looking for a one-time copy. YMMV
Good luck! :-)
:-D
-- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Le 12/10/2020 à 02:28, Carlos E. R. a écrit :
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
El 2020-10-11 a las 23:28 +0200, jdd@dodin.org escribió:
Le 11/10/2020 à 23:08, Carlos E. R. a écrit :
Is there some file browser that will "sanitize" names on the fly?
detox will sanitize file names, but rsync copy any file with any name, given a correct syntax (better not give any file name, only folder name)
Mind, I want a program that:
copies path/"A: name" to another_path/"A_ name"
I do not want to change the files on the source dir. I want a file copy program that sanitizes names only on the destination.
detox is CLI, why not pipe it? https://linux.die.net/man/1/detox jdd -- http://dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 09.01, jdd@dodin.org wrote:
Le 12/10/2020 à 02:28, Carlos E. R. a écrit :
El 2020-10-11 a las 23:28 +0200, jdd@dodin.org escribió:
Le 11/10/2020 à 23:08, Carlos E. R. a écrit :
Is there some file browser that will "sanitize" names on the fly?
detox will sanitize file names, but rsync copy any file with any name, given a correct syntax (better not give any file name, only folder name)
Mind, I want a program that:
copies path/"A: name" to another_path/"A_ name"
I do not want to change the files on the source dir. I want a file copy program that sanitizes names only on the destination.
detox is CLI, why not pipe it?
The examples do not show an example of using with "cp source dest". -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 2020-10-11 23:08, Carlos E. R. wrote:
Hi,
I have to copy some files from Linux to external media formatted as exfat. Some names have a colon, like:
"chapter: 1"
Several programs baulk saying "can not create file, no such file or directory".
Is there some file browser that will "sanitize" names on the fly?
"chapter_ 1"
I can use krusader which will let me change the name of the destination file before starting, if I copy one by one.
Maybe with krename...
Use tar - why not leave the file names as they are? It's a transport medium, so you can tar them back on the receiving side. ;-) Have a nice day, Berny -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 17.18, Bernhard Voelker wrote:
On 2020-10-11 23:08, Carlos E. R. wrote:
Use tar - why not leave the file names as they are? It's a transport medium, so you can tar them back on the receiving side. ;-)
The receiving side is my sitting room TV set. I doubt it will know what to do with that, even less play the movie inside a tar pit... -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 2020-10-12 18:41, Carlos E. R. wrote:
On 12/10/2020 17.18, Bernhard Voelker wrote:
On 2020-10-11 23:08, Carlos E. R. wrote:
Use tar - why not leave the file names as they are? It's a transport medium, so you can tar them back on the receiving side. ;-)
The receiving side is my sitting room TV set. I doubt it will know what to do with that, even less play the movie inside a tar pit...
Often, such TV sets are running some kind of Linux under the hood. I'd try to find out which kind of other file system type it supports. E.g. my Samsung understands XFS (but only if the TV created the file system, i.e., not if the file system was created on the PC). Have a nice day, Berny -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12/10/2020 21.53, Bernhard Voelker wrote:
On 2020-10-12 18:41, Carlos E. R. wrote:
On 12/10/2020 17.18, Bernhard Voelker wrote:
On 2020-10-11 23:08, Carlos E. R. wrote:
Use tar - why not leave the file names as they are? It's a transport medium, so you can tar them back on the receiving side. ;-)
The receiving side is my sitting room TV set. I doubt it will know what to do with that, even less play the movie inside a tar pit...
Often, such TV sets are running some kind of Linux under the hood. I'd try to find out which kind of other file system type it supports. E.g. my Samsung understands XFS (but only if the TV created the file system, i.e., not if the file system was created on the PC).
Well, this one is a Samsung, but doesn't have any type of menu for formatting disks. It would be nice if it supported some Linux filesystem, but I can not be sure I will not try other TV sets, and I don't know the brands. Till today, I used FAT on my USB sticks, or NTFS for bigger files. But now I have an idle SSD disk of 225 gigs or so, and I thought that exfat would be nicer than ntfs on that "big stick". At least they published the spec with the intention that it goes sometime to the Linux kernel. And it is a pleasure to write a movie fast to a stick ;-) -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 11/10/2020 23.08, Carlos E. R. wrote:
Hi,
I have to copy some files from Linux to external media formatted as exfat. Some names have a colon, like:
"chapter: 1"
I saw yesterday on usenet (alt.comp.os.windows-10) a very interesting comment from someone named Andy Burns: AB> When I store PDFs of British Standards, e.g. AB> AB> BS 1363-2꞉2016.pdf AB> AB> I use ꞉ (U+A789) instead of : (U+003A) for the colon in the filename I put together both chars to see the difference: "꞉:" - curious. I wonder what's the name of the first "non-really-a-colon" char. Now I will have to rename all my files with colons :-D -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On Thu, 15 Oct 2020 09:55:36 +0200 "Carlos E. R." <robin.listas@telefonica.net> wrote:
On 11/10/2020 23.08, Carlos E. R. wrote:
Hi,
I have to copy some files from Linux to external media formatted as exfat. Some names have a colon, like:
"chapter: 1"
I saw yesterday on usenet (alt.comp.os.windows-10) a very interesting comment from someone named Andy Burns:
AB> When I store PDFs of British Standards, e.g. AB> AB> BS 1363-2꞉2016.pdf AB> AB> I use ꞉ (U+A789) instead of : (U+003A) for the colon in the AB> filename
I put together both chars to see the difference: "꞉:" - curious. I wonder what's the name of the first "non-really-a-colon" char.
MODIFIER LETTER COLON https://www.fileformat.info/info/unicode/char/a789/index.htm as a search would have told you :P
Now I will have to rename all my files with colons :-D
The name includes a real colon. If you wish to corrupt it to make it possible to store in a restricted filesystem, I would suggest making an obvious change such as using '-' instead of a colon, so that you can easily see and remember what you've done. Better yet, use OS and filesystems that don't need such shenanigans :) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 15/10/2020 12.17, Dave Howorth wrote:
On Thu, 15 Oct 2020 09:55:36 +0200 "Carlos E. R." <robin.listas@telefonica.net> wrote:
On 11/10/2020 23.08, Carlos E. R. wrote:
Hi,
I have to copy some files from Linux to external media formatted as exfat. Some names have a colon, like:
"chapter: 1"
I saw yesterday on usenet (alt.comp.os.windows-10) a very interesting comment from someone named Andy Burns:
AB> When I store PDFs of British Standards, e.g. AB> AB> BS 1363-2꞉2016.pdf AB> AB> I use ꞉ (U+A789) instead of : (U+003A) for the colon in the AB> filename
I put together both chars to see the difference: "꞉:" - curious. I wonder what's the name of the first "non-really-a-colon" char.
MODIFIER LETTER COLON https://www.fileformat.info/info/unicode/char/a789/index.htm
"used as a tone letter in some orthographies Budu (Congo), Sabaot (Kenya), and several Papua New Guinea languages"
as a search would have told you :P
I didn't know where, I was thinking about it O:-)
Now I will have to rename all my files with colons :-D
The name includes a real colon. If you wish to corrupt it to make it possible to store in a restricted filesystem, I would suggest making an obvious change such as using '-' instead of a colon, so that you can easily see and remember what you've done.
But I want to see a colon :-D At least, what seems to be one, close enough.
Better yet, use OS and filesystems that don't need such shenanigans :)
Can't. Tell that to TV makers. :-( Or mp3 players. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 15/10/2020 06:17, Dave Howorth wrote:
Better yet, use OS and filesystems that don't need such shenanigans:)
Indeed. Complexity and complication come back to bite you. -- “Reality is so complex, we must move away from dogma, whether it’s conspiracy theories or free-market,” -- James Glattfelder. http://jth.ch/jbg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 15/10/2020 13.33, Anton Aylward wrote:
On 15/10/2020 06:17, Dave Howorth wrote:
Better yet, use OS and filesystems that don't need such shenanigans:)
Indeed. Complexity and complication come back to bite you.
The complexity is trying to find a TV set that will accept an ext4 external disk. I don't do it out of choice, man. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Carlos E. R. wrote:
On 15/10/2020 13.33, Anton Aylward wrote:
On 15/10/2020 06:17, Dave Howorth wrote:
Better yet, use OS and filesystems that don't need such shenanigans:)
Indeed. Complexity and complication come back to bite you.
The complexity is trying to find a TV set that will accept an ext4 external disk.
TV sets often run Linux anyway :-) like my washing machine. Anyway, it's easy to test it? -- Per Jessen, Zürich (7.3°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 15/10/2020 18.03, Per Jessen wrote:
Carlos E. R. wrote:
On 15/10/2020 13.33, Anton Aylward wrote:
On 15/10/2020 06:17, Dave Howorth wrote:
Better yet, use OS and filesystems that don't need such shenanigans:)
Indeed. Complexity and complication come back to bite you.
The complexity is trying to find a TV set that will accept an ext4 external disk.
TV sets often run Linux anyway :-) like my washing machine. Anyway, it's easy to test it?
Not that easy, that disk has now perhaps 20 gigabytes of contents. I'll first image an 8GB stick and format it as ext4 dd if=/dev/sdg1 of=Toshiba_8G_part1.img bs=16M status=progress conv=sync,noerror mke2fs -t ext4 -O ^has_journal /dev/sdg1 Huh, I forgot to label it. Write some movies to it... Test it... The TV flashes a message rectangle for a second, impossible to see if there is some text. Trying to force the input to the stick with the "source" button on the remote, the USB entry is not even displayed. Complete failure. It is a Samsung. Model UE28J4100 <https://www.displayspecifications.com/en/model/4a4dc2> Recover stick: time dd if=Toshiba_8G_part1.img of=/dev/sdg1 bs=16M status=progress conv=sync,noerror oflag=direct -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
participants (19)
-
Andrei Borzenkov
-
Anton Aylward
-
Bengt Gördén
-
Bernhard Voelker
-
Carlos E. R.
-
Carlos E.R.
-
Christian Boltz
-
Dave Howorth
-
David C. Rankin
-
David T-G
-
Doug McGarrett
-
James Knott
-
jdd@dodin.org
-
Knurpht-openSUSE
-
mararm
-
Mathias Homann
-
Per Jessen
-
Roger Oberholtzer
-
Simon Becherer