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
How can I set the default rwx permission to all users on every file which is created in the current shell?
What is $1 in shell scripting?
Can you write a script to portray how set –x works?
How do you know which shell I am using?
How to write a function?
How will you print the login names of all users on a system?
how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?
How to use arguments in a script?
I have 2 files and I want to print the records which are common to both.
What are the two files of crontab command?
What does echo mean in scripting?
How do I open the shell prompt?
What is console line?
Given a file find the count of lines containing the word "abc".
What does $$ mean in shell script?