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

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -