
Bash Shell Scripting
- or -
Post a project like this2473
£100/hr(approx. $135/hr)
- Posted:
- Proposals: 9
- Remote
- #2340588
- PRE-FUNDED
- Awarded
Infrastructure Monitoring Expert with Tools like Nagios , Prometheus , Grafana etc.
✪ Top Web & Mobile - Laravel | WordPress | WooCommerce | AngularJS | VueJS | Android | iOS | APIs | NodeJS | Blockchain | Cloud Expert

23+ years expert in PHP, MySQL, HTML, CSS, JavaScript, jQuery, Ajax, Bootstrap, Chrome Extension, VB, VBA, AutIT Programming & Website Data Scraping
1056489256751925002362507173232476258674426191555743932650280
Description
Experience Level: Intermediate
I need a shell script to change the name of files/directories with spaces in the name to be dashes instead of spaces. So, if a file/directory were named "A B", the new name would be A-B.
The script will work on a directory specified on the command line and replace the spaces in the names for all files/directories underneath that directory.
The options to the script are as follows:
-f the -f to only rename files
-d the -d to only rename directories
Both -d and and -f may be specified.
Example:
$ls
C D/
./C D
./C D/E F
./C D/E F/G H
./C D/E F/G H/J K
./C D/E F/G H/J K/a b
./C D/E F/G H/a b
./C D/E F/a b
./C D/a b
After script runs:
C-D
C-D/E-F
C-D/E-F/G-H
C-D/E-F/G-H/a-b
C-D/E-F/G-H/J----K
C-D/E-F/G-H/J----K/a-b
C-D/E-F/a-b
C-D/a-b
Some of the code will be provide and the final script must implement the code that will be provided.
The script will work on a directory specified on the command line and replace the spaces in the names for all files/directories underneath that directory.
The options to the script are as follows:
-f the -f to only rename files
-d the -d to only rename directories
Both -d and and -f may be specified.
Example:
$ls
C D/
./C D
./C D/E F
./C D/E F/G H
./C D/E F/G H/J K
./C D/E F/G H/J K/a b
./C D/E F/G H/a b
./C D/E F/a b
./C D/a b
After script runs:
C-D
C-D/E-F
C-D/E-F/G-H
C-D/E-F/G-H/a-b
C-D/E-F/G-H/J----K
C-D/E-F/G-H/J----K/a-b
C-D/E-F/a-b
C-D/a-b
Some of the code will be provide and the final script must implement the code that will be provided.
Liam A.
100% (3)Projects Completed
2
Freelancers worked with
1
Projects awarded
50%
Last project
5 Apr 2019
United States
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
Hi Liam,
Do you want to rename files/folders recursively inside sub-folders. Would you also like to add an option -r like -f or -d to rename recursively.
783697
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies