Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How can I set the default rwx permission to all users on every file which is created in the current shell?

1374


What is $1 in shell scripting?

989


Can you write a script to portray how set –x works?

957


How do you know which shell I am using?

987


How to write a function?

984


How will you print the login names of all users on a system?

919


how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?

4020


How to use arguments in a script?

1038


I have 2 files and I want to print the records which are common to both.

1110


What are the two files of crontab command?

1144


What does echo mean in scripting?

959


How do I open the shell prompt?

1139


What is console line?

924


Given a file find the count of lines containing the word "abc".

1497


What does $$ mean in shell script?

994