diff options
-rw-r--r-- | lecture_notes/source/using_linux_tools/handout.rst | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lecture_notes/source/using_linux_tools/handout.rst b/lecture_notes/source/using_linux_tools/handout.rst index 5ef762a..046e0d3 100644 --- a/lecture_notes/source/using_linux_tools/handout.rst +++ b/lecture_notes/source/using_linux_tools/handout.rst @@ -1986,13 +1986,15 @@ hyphens. echo $f|tr -s " " "-"|cut -d - -f 2- done -Now we just replace the echo command with a ``mv`` command. +Now we just replace the echo command with a ``mv`` command. Note that ``Si`` +has to be within quotes as ``mv`` takes it to be 2 different inputs as it has +space in it. :: for i in *.mp3 do - mv $i `echo $f|tr -s " " "-"|cut -d - -f 2-` + mv "$i" `echo $f|tr -s " " "-"|cut -d - -f 2-` done ``while`` |