Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't mvbak on a file with an empty space #7

Open
BarbzYHOOL opened this issue Feb 25, 2019 · 6 comments
Open

Can't mvbak on a file with an empty space #7

BarbzYHOOL opened this issue Feb 25, 2019 · 6 comments

Comments

@BarbzYHOOL
Copy link
Contributor

mvbak "my test file"
mv: target ‘file.20190225_155546.bak’ is not a directory

I also get other errors:

mvbak eee\ \(autre\ copie\)
autre: command not found
- (line 1): 
autre copie
^
in command substitution
	called on line -1 of file -

from sourcing file -
	called on line 60 of file /usr/share/fish/functions/eval.fish

in function 'eval'
	called on line 6 of file ~/.config/fish/fundle/BarbzYHOOL/plugin-bak/functions/__bak.fish

in function '__bak'
	called on line 5 of file ~/.config/fish/fundle/BarbzYHOOL/plugin-bak/functions/mvbak.fish
	with parameter list 'mvbak mv eee (autre copie)'

in function 'mvbak'
	called on standard input
	with parameter list 'eee (autre copie)'

autre: command not found
- (line 1): 
autre copie
^
in command substitution
	called on line -1 of file -

from sourcing file -
	called on line 60 of file /usr/share/fish/functions/eval.fish

in function 'eval'
	called on line 6 of file ~/.config/fish/fundle/BarbzYHOOL/plugin-bak/functions/__bak.fish

in function '__bak'
	called on line 5 of file ~/.config/fish/fundle/BarbzYHOOL/plugin-bak/functions/mvbak.fish
	with parameter list 'mvbak mv eee (autre copie)'

in function 'mvbak'
	called on standard input
	with parameter list 'eee (autre copie)'

mv: cannot stat ‘eee’: No such file or directory

I tried to fix it by adding quotes to some variables, but it still doesn't work

Usage:
  mvbak SOURCE...

Need some guidance here :'( @bobthecow

@BarbzYHOOL
Copy link
Contributor Author

Ok I found the solution, but which one is better?

function mvbak --description 'Rename files to make a backup copies'
  __bak mvbak mv '$argv'
end
function mvbak --description 'Rename files to make a backup copies'
  __bak mvbak mv \"$argv\"
end

The second one looks better to me (cause it's clear)

@BarbzYHOOL
Copy link
Contributor Author

BarbzYHOOL commented Feb 25, 2019

Also if you have a dir called "foo bar/" it will fail to remove the "/"

__mv_bak_name works fine but the overall program does not:

mvbak pa\ pa\ pa/                                                            
mv: cannot move ‘pa pa pa/’ to a subdirectory of itself, ‘pa pa pa/.20190225_162111.bak’

@BarbzYHOOL
Copy link
Contributor Author

@bobthecow @scorphus

@BarbzYHOOL
Copy link
Contributor Author

@scorphus
Copy link
Member

Would you kindly open a PR?

Thank you!

@BarbzYHOOL
Copy link
Contributor Author

i tried to do it #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants