Skip to content

A bash script to split a folder into sub-folders based on the first letter of the file names.

Notifications You must be signed in to change notification settings

tmcadam/split-folders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

split-folders Build Status

Automated testing in BASH

Automated tests in bash using Bash Automated Testing System. Using the example of a bash script to split a folder into sub-folders based on the first letter of the file names. Also has a Travis pipeline setup.

Installation

  • Install BATS
    sudo add-apt-repository ppa:duggan/bats --yes
    sudo apt-get update
    sudo apt-get install bats
    
  • Clone the repo
    git clone https://github.com/tmcadam/split-folders.git
    

Running tests

  • Change directory to the cloned repo
  • Run BATS
    bats test-split-folder.bats
    

Usage

  • Change directory to the cloned repo
  • Run the script
    bash split-folder.sh --help
    
    bash split-folder.sh --dry-run <target_directory>
    
    bash split-folder.sh <target_directory>
    

About

A bash script to split a folder into sub-folders based on the first letter of the file names.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages