/ Published in: Awk
This is some ugly-ass code, but it works to see if you need to update the atlassian jira jars. Meant to be in /opt/j2ee/domains/domainname.com/instance/tomcat/lib/newdir
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
for i in *.jar; do set -- `echo $i |awk -F- '{sub(/.jar/,"",$0)} {if ($2 !~ /[0-9]/) {print $1"-"$2,$3} else {print $1,$2} }'`;jarname=$1;newver=$2; set -- `ls ../*.jar |grep "$jarname-[0-9]" |awk -F- '{sub(/.jar/,"",$0)} {if ($2 !~ /[0-9]/) {print $3} else {print $2} }'`; if [ "$newver" != "$1" ]; then echo $jarname $newver $1; fi; done