1

I am trying to edit the following script to add a part to remove all files within a folder containing the word TRAR in their filename. This is a Linux system, I want to add in a part like this :

 cd /appl/virtuo/gways/config/input_d
 rm -rf TRAR*

The above I cannot get to run, but when I try manually, I am able to do it, I want to add into the below script and am quite lost, as this is my first time writing such a script

VENDOR=ericsson-msc
RELEASE=R13.2
BASE_DIR=/appl/virtuo/gways
RAW_DIR=${BASE_DIR}/config/${VENDOR}/${RELEASE}/trdipfile_raw_landing_area



cd ${RAW_DIR}

ssh netperf@10.76.26.1 "cd /var/opt/ericsson/sgw/outputfiles/apgfiles/oms ; find . -newer ~/msc-         trdif-timestamp -type f | egrep TRDIP | cpio -oc ; touch ~/msc-trdif-timestamp" 2>/dev/null | cpio -icdu 2>/dev/null
user2586302
  • 71
  • 2
  • 3
  • 8

1 Answers1

0

i tried it both without quotes and with, try quotes and it should work, just tested, also if you want to delete all instances containing "TRAR" you should use wildcard before and after:

rm -rf *"TRAR"*

you can also try to save it to variable and test:

delit="TRAR"
rm -rf "$delit"*
midori
  • 4,807
  • 5
  • 34
  • 62