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 / 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


Please Help Members By Posting Answers For Below Questions

Which shell is the best?

991


Explain about return code?

1071


What is sudo command?

1055


I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?

2171


What are the various stages of a linux process it passes through?

1182


Is shell scripting a language?

1040


How to print all the arguments provided to the script?

961


What language is shell scripting?

1028


How do I run a .sh file on mac?

1181


State the advantages of shell scripting?

1050


How to print the first array element?

1035


Write a script to print the first 10 elements of fibonacci series.

2343


Which scripting language is best for automation?

958


How to get script name inside a script?

1010


What is scripting autism?

1214