How do you rename the files(*.sh) with file names containing space in it?for example "interview question.sh" needs to rename to "interview-question.sh".
Appreciate your inputs.Thanks.
Answer Posted / senthil m
For single file, you can do following command;
mv interview\ question.sh interview-question.sh
For multiple files on the current working folder;
for i in *\ *.sh
do
j=`echo $i|sed "s/ /-/g"`
mv "$i" $j
done
Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
What happens when you type ls?
What is a boot block?
Explain about return code?
Why are shell scripts used?
How to print all the arguments provided to the script?
What is awk in shell scripting?
How can we find the process name from its process id?
How do I edit a .sh file?
Is shell scripting easy to learn?
What is web script?
Set up a Sev 2 alert when the Primary WA service fails. A windows batch script needs to be created that will monitor the WA service on the Primary and when the service stops/fails a Sev 2 TT is generated for a particular team ?
What is .sh file in mac?
What is sudo command?
is this growing field and what is average package in this?
Is scripting and coding the same thing?