variables - Bash - compare parameters thrown as $@ and pass them as $1 $2 accordingly -


i use exiftool copy metadata 1 file another.

exiftool -tagsfromfile file1[source] file2[target] 

i trying speed workflow , figure out bash script allow me select 2 files in file explorer - right click on them - open - thescript.sh

/path/to/thescript.sh $1 $2 

as can see important part select right file source ($1) / target ($2).

source files named this: 20170630_181348_2674.jpg or 20170630_181348_2674.dng target files have suffix added name e.g. 20170630_181348_2674_0001.jpg or 20170630_181348_2674_v2.jpg

so 1 thing know sure source file name shorter.

another thing, files use source older ones copy metadata to.

i wondering if there way in bash compare inputs ($@) file name or file modify date , place them $1 , $2 accordingly. ideas appreciated.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -