bash - Linux shell script: Renaming files according to directory name -


i trying create sh/bash script rename files according directory names. example if there directory named linux, files inside should renamed linux.jpg, linux2.jpg, linux3.jpg etc. there more 1 directory within main example directory other files also.

it must work within copy script if possible, copying directory across folder, when done i'd rename process happen. here copy script:

#!/bin/sh if cp -r "$1" "$2" echo "copy success!" else echo "copy failed!" fi 

it seems question answered here, please check out: shell script rename files based on directory names


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -