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
Which shell is the best?
Explain about return code?
What is sudo command?
I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?
What are the various stages of a linux process it passes through?
Is shell scripting a language?
How to print all the arguments provided to the script?
What language is shell scripting?
How do I run a .sh file on mac?
State the advantages of shell scripting?
How to print the first array element?
Write a script to print the first 10 elements of fibonacci series.
Which scripting language is best for automation?
How to get script name inside a script?
What is scripting autism?