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 is the first line of a shell script called?
What language is bash written in?
What does $1 mean in bash?
is this growing field and what is average package in this?
Write a shell script to get current date, time, user name and current working directory.
I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?
How do I start a shell script?
What are the types of script?
shell script for reverse the string
What is sudo command?
how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?
How important is shell scripting?
How to calculate the number of passed arguments?
What are different types of shell?
What are the different types of shell scripting?