lf
lf copied to clipboard
How to use $fx for a shell command ?
Say I just select two files and run $rm $fx
, but it reports error:
rm: cannot remove '/home/monottx/test/1.txt'$'\n''/home/monottx/test/2.txt': No such file or directory
I have tried to use " "
, "\r"
for ifs
and filesep
option, but none worked.
e.g. If set filesep " "
, I would get:
rm: cannot remove '/home/monottx/test/1.txt /home/monottx/test/2.txt': No such file or directory
Did you try set ifs "\n"
? It should be the same as filesep
for convenience.
Did you try
set ifs "\n"
? It should be the same asfilesep
for convenience.
I have downloaded the lfrc.example
to /etc/lf/lfrc
, and its ifs
is by default set as "\n"
. It still cannot work as I expected. In fact, I could tell no difference whether I change its value when I check the output of $fx
using $echo $fx
.
I'm guessing you use zsh. Zsh does not split words by default. You need to add -y
to shellopts
. See https://github.com/gokcehan/lf/wiki/Tips#split-words-by-default-in-zsh. This should probably be mentioned in the documentation.
I'm guessing you use zsh. Zsh does not split words by default. You need to add
-y
toshellopts
. See https://github.com/gokcehan/lf/wiki/Tips#split-words-by-default-in-zsh. This should probably be mentioned in the documentation.
YES! This helps me out, thank you @p-ouellette very much!
I have the same problem with bash. It only appears when I select more than 1 file and one of the filenames (or more) contains a whitespace.
I've found where is the problem is. IFS
is not exported to subshell that is started by typing w
. In "internal" shell (after typing $
or %
) all works fine. Is it possible to export IFS
to subshell?