I would like to delete the spaces at the end of my folder names.
I have a folder called "Project1 " in which I have another folder called "Exercise1 ".
I want to use a script to delete the spaces at the end and only at the end.
I don't know if I have expressed myself correctly.
Thank you in advance, have a nice evening.
I typed the command /bin/ls -l | od -c
root@debian:~$ /bin/ls -l | od -c
0000000 t o t a l 3 2 \n d r w x r - x
0000020 r - x 2 k a b i a k a b i
0000040 a 4 0 9 6 j u i l . 2 0
0000060 1 0 : 2 6 B u r e a u \n d r w
0000100 x r - x r - x 7 k a b i a
0000120 k a b i a 4 0 9 6 j u i l .
0000140 2 2 1 7 : 4 6 D o c u m e
0000160 n t s \n d r w x r - x r - x 2
0000200 k a b i a k a b i a 4 0 9
0000220 6 j u i l . 2 2 1 9 : 2 6
0000240 I m a g e s \n d r w x r - x r
0000260 - x 2 k a b i a k a b i a
0000300 4 0 9 6 j u i l . 2 0 1
0000320 0 : 2 6 M o d 303 250 l e s \n d r
0000340 w x r - x r - x 2 k a b i a
0000360 k a b i a 4 0 9 6 j u i l
0000400 . 2 0 1 0 : 2 6 M u s i q
0000420 u e \n d r w x r - x r - x 2
0000440 k a b i a k a b i a 4 0 9 6
0000460 j u i l . 2 0 1 0 : 2 6
0000500 P u b l i c \n d r w x r - x r -
0000520 x 2 k a b i a k a b i a
0000540 4 0 9 6 j u i l . 2 0 1 0
0000560 : 2 6 T 303 251 l 303 251 c h a r g e
0000600 m e n t s \n d r w x r - x r - x
0000620 2 k a b i a k a b i a 4
0000640 0 9 6 j u i l . 2 0 1 0 :
0000660 2 6 V i d 303 251 o s \n
0000673
I have taken into account your answer and thank you. However, it still doesn't work. When I run my script, my folders with spaces at the end are not renamed. Also, I am trying to run this code in bash. I am testing things on my side but I am still at the same point. But thank you very much for your answers and your reactivity.
– Frod0n Jul 22 '21 at 12:55