variables - Bash - compare parameters thrown as $@ and pass them as $1 $2 accordingly -
this question has answer here:
- change command line argument in bash 2 answers
- how compare timestamp on files in bash scripting 3 answers
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
Post a Comment