Hi...
I am trying to do some string substitution...
I have a file called OBJList1.txt and it's content goes like this...
---
Sphere1 Cone1 Cube1 Cylinder1 Sphere2 Cone2 pCube1 Cylinder2
---
In one of my functions, I need to delete a certain word from the file and update the file at the same time...
So, I tried to use sed and it didn't work for me...
---
sed 's/${toDelete}//g' $OBJLIST1 > $OBJLIST1
---
Say that the word to delete is 'Cube1' and the variable 'toDelete' gets the value, and the output should be like this, but I cannot make it working...
---
Sphere1 Cone1 Cylinder1 Sphere2 Cone2 pCube1 Cylinder2
---
I am trying to figure this out for an hour with several variations but no luck yet...
Can someone tell me how to do this???
TIA
Jason
I am trying to do some string substitution...
I have a file called OBJList1.txt and it's content goes like this...
---
Sphere1 Cone1 Cube1 Cylinder1 Sphere2 Cone2 pCube1 Cylinder2
---
In one of my functions, I need to delete a certain word from the file and update the file at the same time...
So, I tried to use sed and it didn't work for me...
---
sed 's/${toDelete}//g' $OBJLIST1 > $OBJLIST1
---
Say that the word to delete is 'Cube1' and the variable 'toDelete' gets the value, and the output should be like this, but I cannot make it working...
---
Sphere1 Cone1 Cylinder1 Sphere2 Cone2 pCube1 Cylinder2
---
I am trying to figure this out for an hour with several variations but no luck yet...
Can someone tell me how to do this???
TIA
Jason