Advertisement
emanuele

Create files and dirs from file

Feb 4th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.18 KB | None | 0 0
  1. #!/bin/bash
  2. basepath=$(pwd)
  3. while IFS='' read -r line || [[ -n "$line" ]]; do
  4.    
  5.     line="$basepath/$line"
  6.     mkdir -p "$(dirname "$line")"
  7.     touch "$line"
  8. done < "$1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement