summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeet Shah2015-01-21 04:40:27 +0530
committerMeet Shah2015-01-21 04:40:27 +0530
commit0dc0dfb777b91c64b3bba3370948fbe008f5a580 (patch)
tree0f1ba93076e6bf38436c460fc6a5f9807b2e8211
parentd6eca672461aa999fa58596100570029d482d2a7 (diff)
downloadsees-0dc0dfb777b91c64b3bba3370948fbe008f5a580.tar.gz
sees-0dc0dfb777b91c64b3bba3370948fbe008f5a580.tar.bz2
sees-0dc0dfb777b91c64b3bba3370948fbe008f5a580.zip
Fixed minor error in sample command in main slides.
A sample on application of mv command for renaming files had a minor error. Since the files to be renamed were being taken in a loop and they had spaces in their names, the mv command took the 2 parts of the string '$i' as its 2 inputs.Changed $i to "$i" and it works just fine.
-rw-r--r--lecture_notes/source/using_linux_tools/handout.rst6
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``