I have a file with SNAPSHOT in the name and I want to copy the file over to a new destination. I am not working within that directory, so I'll be using direct paths. I'm not great with bash commands so this is giving me some trouble. I feel though this should be very trivial.
This will be put into a script that will be copy hundreds of JAR files with the SNAPSHOT string attached to the file name. Here is something I have been working with but has been giving me trouble if my current working directory is not in the tree level of those jars.
cp "${SRC_PATH}"/grid-start/target/grid-start-* "${INSTALLER_PATH}"/boot/$(ls "${SRC_PATH}"/grid-start/target/*SNAP* | sed "s/-SNAPSHOT//")
Scenario:
File: /home/build/src/trunk/grid-start/target/grid-start-1.6-SNAPSHOT.jar
Dest: /home/build/installer/boot/grid-start-1.6.jar
Thanks!