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 / chetan
sorry, forgot to keep the "mv" command in my last post.
for i in *.sh
do
n=`echo $i|sed 's/ /-/g'`
mv "$i" $n
done
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What is awk in shell scripting?
What is a shell? · Types of shell · what is shell scripting?
What language is bash?
What is path variable bash?
Suppose you execute a command using exec, what will be the status of your current process in the shell?
What are the disadvantages of shell scripting?
Give some situations where typing error can destroy a program?
What is shift command in shell script?
What does path stand for?
Given a file find the count of lines containing the word "abc".
What is shell prompt?
State the advantages of shell scripting?
What is shell company all about?
How will you connect to a database server from linux?
Is bash a shell script?