I was to search a file for a particular string and delete it from the file.
Is sed the best way of doing this?
I've tried this:
But it doesn't actually delete anything.
This:
...deletes the whole file
I need to use busybox for this as it has be run on a Android device...
Is sed the best way of doing this?
I've tried this:
Code:
#!/sbin/sh
busybox sed 's/String_1/ /' /system/file.txt
busybox sed 's/String_2/ /' /system/file.txt
busybox sed 's/String_3/ /' /system/file.txt
But it doesn't actually delete anything.
This:
Code:
#!/sbin/sh
busybox sed 's/String_1/ /' /system/file.txt > /system/file.txt
busybox sed 's/String_2/ /' /system/file.txt > /system/file.txt
busybox sed 's/String_3/ /' /system/file.txt > /system/file.txt
...deletes the whole file
I need to use busybox for this as it has be run on a Android device...







