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 / chetan
sorry, forgot to keep the "mv" command in my last post.
for i in *.sh
do
n=`echo $i|sed 's/ /-/g'`
mv "$i" $n
done
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
How do I run a .sh file on mac?
Is shell and terminal the same?
I want to create a directory such that anyone in the group can create a file and access any person's file in it but none should be able to delete a file other than the one created by himself.
How to write a function?
Why do we use shell scripting?
I want to connect to a remote server and execute some commands, how can I achieve this?
What is the purpose of scripting?
What does echo $0 do?
shell script for reverse the string
What is .sh file in mac?
Is shell scripting a programming language?
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.
c program which behaves like a shell(command interpreter). it has its own prompt say "NewShell$".any normal shell command is executed from your shell by starting a child process to execute a system program corrosponding to the command
Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.
How to set an array in linux?