View previous topic :: View next topic |
Author |
Message |
sdauth l33t


Joined: 19 Sep 2018 Posts: 712 Location: Ásgarðr
|
Posted: Fri May 16, 2025 1:33 am Post subject: [SOLVED] btrfs send (pipe) return command not found |
|
|
Hello,
Suddenly, I'm unable to pipe "btrfs send" to plzip (backup a subvolume to a lzip archive)
Code: |
(root) ~ btrfs send my-subvolume | plzip -0 - > /mnt/backup/my-subvolume.lzip
bash: plzip : command not found |
(fails with sudo too)
I tried to pass the full path too (/usr/bin/plzip) but it still doesn't work.
Other pipe like:
sudo dmesg | less
or grepping text with "cat file.txt | grep x" for example works fine.
Any idea ?
Last edited by sdauth on Fri May 16, 2025 3:57 am; edited 1 time in total |
|
Back to top |
|
 |
Hu Administrator

Joined: 06 Mar 2007 Posts: 23485
|
Posted: Fri May 16, 2025 1:38 am Post subject: |
|
|
Your error message says command not found. Do you think bash is wrong not to find this command? What is the output of namei -l /usr/bin/plzip? |
|
Back to top |
|
 |
sdauth l33t


Joined: 19 Sep 2018 Posts: 712 Location: Ásgarðr
|
Posted: Fri May 16, 2025 1:42 am Post subject: |
|
|
Yes, plzip is installed.
Code: | type -a plzip
plzip is /usr/bin/plzip
namei -l /usr/bin/plzip
f: /usr/bin/plzip
drwxr-xr-x root root /
drwxr-xr-x root root usr
drwxr-xr-x root root bin
-rwxr-xr-x root root plzip |
If I remove the space after the pipe then it works :
Code: | btrfs send my-subvolume |plzip -0 - > /mnt/backup/my-subvolume.lzip |
Very strange.
Code: | sudo dmesg | less
sudo dmesg |less
|
both work for example but with plzip, it only works if I remove the space. |
|
Back to top |
|
 |
sdauth l33t


Joined: 19 Sep 2018 Posts: 712 Location: Ásgarðr
|
Posted: Fri May 16, 2025 1:58 am Post subject: |
|
|
Although there is only one whitespace after the pipe, you can see there are two before "plzip" in the error message. (Or maybe is it normal ?)
Code: | bash: plzip : command not found |
with bash -x
Code: | + plzip -0 -
+ btrfs send my-subvolume
bash: plzip : command not found |
as you can see, two whitespace are added before plzip although I only typed one.
with "dmesg | less", no problem, only one whitespace :
Code: | ~ dmesg | less
+ less
+ dmesg |
|
|
Back to top |
|
 |
RumpletonBongworth Tux's lil' helper


Joined: 17 Jun 2024 Posts: 104
|
Posted: Fri May 16, 2025 2:23 am Post subject: |
|
|
sdauth wrote: | If I remove the space after the pipe then it works :
Code: | btrfs send my-subvolume |plzip -0 - > /mnt/backup/my-subvolume.lzip |
Very strange. |
The explanation is that it wasn't an ASCII space (U+0020). Though this nuance wasn't preserved by your post, I can assure you that it is the case. Most likely, it was a UTF-8 encoded non-breaking space (U+000A) or some other similar codepoint.
EDIT: Added, but then removed, an alternative theory, which I realised to be unlikely.
Last edited by RumpletonBongworth on Fri May 16, 2025 2:55 am; edited 2 times in total |
|
Back to top |
|
 |
RumpletonBongworth Tux's lil' helper


Joined: 17 Jun 2024 Posts: 104
|
Posted: Fri May 16, 2025 2:30 am Post subject: |
|
|
Test case …
Code: | # printf ': |\xC2\xA0plzip\n' | bash
bash: line 1: plzip: command not found |
|
|
Back to top |
|
 |
sdauth l33t


Joined: 19 Sep 2018 Posts: 712 Location: Ásgarðr
|
Posted: Fri May 16, 2025 3:06 am Post subject: |
|
|
Thanks.
Well, it looks like it is indeed the case, I removed "plzip" up to the pipe (to make sure to clear the space) then hit space again and typed again plzip (without hitting tab for autocompletion, although it is probably not relevant) and this time it worked.
What I don't understand though is how the space was somehow different the first time...
I typed the command as I usually do, no copy paste. I use xfce4-terminal if that's relevant. |
|
Back to top |
|
 |
RumpletonBongworth Tux's lil' helper


Joined: 17 Jun 2024 Posts: 104
|
Posted: Fri May 16, 2025 3:34 am Post subject: |
|
|
sdauth wrote: | Thanks.
Well, it looks like it is indeed the case, I removed "plzip" up to the pipe (to make sure to clear the space) then hit space again and typed again plzip (without hitting tab for autocompletion, although it is probably not relevant) and this time it worked.
What I don't understand though is how the space was somehow different the first time...
I typed the command as I usually do, no copy paste. I use xfce4-terminal if that's relevant. |
I'll hazard a guess: Shift + Space yields a NBSP for your present setup. If that be true, it's not hard to imagine the Shift key being still pressed down after entering the vertical bar character, while pressing the Space bar. |
|
Back to top |
|
 |
sdauth l33t


Joined: 19 Sep 2018 Posts: 712 Location: Ásgarðr
|
Posted: Fri May 16, 2025 3:45 am Post subject: |
|
|
I looked at my history to copy paste the problematic space.
(I don't know if it will be rendered correctly here, probably not)
Code: | printf ' ' | cat -e
M-BM- |
I realized my mistake...
To enter the pipe character "|" ; I press AltGr + 6.
If I enter space while AltGr is still pressed, then it creates the wrong space. This was the case here... my finger was somehow stuck to AltGr....
Thanks for your help RumpletonBongworth !
edit:
Code: | xev : space
KeyRelease event, serial 37, synthetic NO, window 0x3800001,
root 0xfa, subw 0x0, time 19210731, (350,121), root:(901,460),
state 0x0, keycode 65 (keysym 0x20, space), same_screen YES,
XLookupString gives 1 bytes: (20) " "
XFilterEvent returns: False
xev : altgr + space
KeyRelease event, serial 37, synthetic NO, window 0x3800001,
root 0xfa, subw 0x0, time 19252340, (-73,271), root:(478,610),
state 0x80, keycode 65 (keysym 0xa0, nobreakspace), same_screen YES,
XLookupString gives 2 bytes: (c2 a0) " "
XFilterEvent returns: False |
Last edited by sdauth on Fri May 16, 2025 3:56 am; edited 1 time in total |
|
Back to top |
|
 |
RumpletonBongworth Tux's lil' helper


Joined: 17 Jun 2024 Posts: 104
|
Posted: Fri May 16, 2025 3:48 am Post subject: |
|
|
This board mangles (at least) UTF-8 whitespace, indeed. It ends up being ASCII whitespace. |
|
Back to top |
|
 |
RumpletonBongworth Tux's lil' helper


Joined: 17 Jun 2024 Posts: 104
|
Posted: Fri May 16, 2025 4:04 am Post subject: |
|
|
Perhaps XFCE has an option for this already but I think that this will address the issue:
Code: | setxkbmap -option nbsp:none |
|
|
Back to top |
|
 |
|