Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

script: renumdir.sh: rename dirs to sequentially numbered ones

#!/bin/bash## renumdir.sh: renames Dirs to sequentially# Numbered ones starting from 00001 # ex. 00001 00002 00003 00004 etc.## questions? suggestions? comments?# grulosΨgmail.com#cd $1 || exit 1typeset -a files=(*)typeset -i j=1for i in "${files[@]}"; do if [ -d "$i" ]; then # infinite loop until we find the next # numbered dir we are going to use while true; do fname=0000$j;



This post first appeared on Unix Art, please read the originial post: here

Share the post

script: renumdir.sh: rename dirs to sequentially numbered ones

×

Subscribe to Unix Art

Get updates delivered right to your inbox!

Thank you for your subscription

×