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

What is the first line of a shell script called?

1031


What language is bash written in?

947


What does $1 mean in bash?

1026


is this growing field and what is average package in this?

2243


Write a shell script to get current date, time, user name and current working directory.

1028


I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?

1255


How do I start a shell script?

1124


What are the types of script?

1089


shell script for reverse the string

1339


What is sudo command?

973


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

4017


How important is shell scripting?

983


How to calculate the number of passed arguments?

1000


What are different types of shell?

877


What are the different types of shell scripting?

1031