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 / indusharma5
I tried following, but it doesn't work.
find . -name "*.sh" -0 -print0| xargs -n1 -I{} -0 sh -c '`mv {} echo "{}"|sed -n 's/ /-/g'`'
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is subshell?
What is the command to find out users on the system?
What is shift command in shell script?
How to find all the files modified in less than 3 days and save the record in a text file?
What are the zombie processes?
What is $1 in shell scripting?
Explain about stdin, stdout and stderr?
How to check if the previous command was run successfully?
What is the syntax of while loop in shell scripting?
Given a file find the count of lines containing the word "abc".
What does $$ mean in shell script?
How does ls command work?
What is a shell environment?
what is tickets $ what low,medium,high priorite pls define time also
What are the default permissions of a file when it is created?