Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] btrfs send (pipe) return command not found
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 712
Location: Ásgarðr

PostPosted: Fri May 16, 2025 1:33 am    Post subject: [SOLVED] btrfs send (pipe) return command not found Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23485

PostPosted: Fri May 16, 2025 1:38 am    Post subject: Reply with quote

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
View user's profile Send private message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 712
Location: Ásgarðr

PostPosted: Fri May 16, 2025 1:42 am    Post subject: Reply with quote

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
View user's profile Send private message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 712
Location: Ásgarðr

PostPosted: Fri May 16, 2025 1:58 am    Post subject: Reply with quote

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
View user's profile Send private message
RumpletonBongworth
Tux's lil' helper
Tux's lil' helper


Joined: 17 Jun 2024
Posts: 104

PostPosted: Fri May 16, 2025 2:23 am    Post subject: Reply with quote

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
View user's profile Send private message
RumpletonBongworth
Tux's lil' helper
Tux's lil' helper


Joined: 17 Jun 2024
Posts: 104

PostPosted: Fri May 16, 2025 2:30 am    Post subject: Reply with quote

Test case …
Code:
# printf ': |\xC2\xA0plzip\n' | bash
bash: line 1:  plzip: command not found
Back to top
View user's profile Send private message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 712
Location: Ásgarðr

PostPosted: Fri May 16, 2025 3:06 am    Post subject: Reply with quote

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
View user's profile Send private message
RumpletonBongworth
Tux's lil' helper
Tux's lil' helper


Joined: 17 Jun 2024
Posts: 104

PostPosted: Fri May 16, 2025 3:34 am    Post subject: Reply with quote

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
View user's profile Send private message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 712
Location: Ásgarðr

PostPosted: Fri May 16, 2025 3:45 am    Post subject: Reply with quote

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.... :oops:
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
View user's profile Send private message
RumpletonBongworth
Tux's lil' helper
Tux's lil' helper


Joined: 17 Jun 2024
Posts: 104

PostPosted: Fri May 16, 2025 3:48 am    Post subject: Reply with quote

This board mangles (at least) UTF-8 whitespace, indeed. It ends up being ASCII whitespace.
Back to top
View user's profile Send private message
RumpletonBongworth
Tux's lil' helper
Tux's lil' helper


Joined: 17 Jun 2024
Posts: 104

PostPosted: Fri May 16, 2025 4:04 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



OSZAR »