Use:
jar -xf sample.ear com1/test1/file1.sh
to extract file.sh
. Once you are done modifying this com1/test1/file1.sh
file use:
jar -uf sample.ear com1/test1/file1.sh
to update the archived ear with the modified file.
Use jar --help
for detailed help.