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
What is a program shell?
How do I run a powershell script?
c program to implement unix/linux command to block the signal ctrl-c and ctrl-\ signal during the execution ls -l|wc -l
Suppose you execute a command using exec, what will be the status of your current process in the shell?
How to set an array in linux?
What does $0 mean in shell script?
What is in a script?
How are shells born?
What are the different types of variables used in shell script?
Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.
Write a shell script that adds two numbers if provided as the command line argument and if the two numbers are not entered throws an error message.
When should shell programming/scripting not be used?
How to find all the files modified in less than 3 days and save the record in a text file?
What does path stand for?
Write down the syntax for all the loops in shell scripting.