Skip to main content
update the answer
Source Link
user1794469
  • 4.2k
  • 1
  • 27
  • 42

You can use find to get the files recursively and then sed to make the changes inline. This should work if I understand your goal correctly:

find . -name 'sed.c' -print0 | xargs -0 sed -i 's/%s/%d/g; s/bcm_errstr(rv)/rv/g;' 

Note: that this may match more than you want but you have pretty limited target behavior listed. You'll need to adjust the find part to filter for only the files you are targeting.

You can use find to get the files recursively and then sed to make the changes inline. This should work if I understand your goal correctly:

find . -name 'sed.c' -print0 | xargs -0 sed -i 's/%s/%d/g; s/bcm_errstr(rv)/rv/g;' 

Note: that this may match more than you want but you have pretty limited target behavior listed. You'll need to adjust the find part to filter for only the files you are targeting.

You can use find to get the files recursively and then sed to make the changes inline. This should work if I understand your goal correctly:

find . -print0 | xargs -0 sed -i 's/%s/%d/g; s/bcm_errstr(rv)/rv/g;' 

Note: that this may match more than you want but you have pretty limited target behavior listed. You'll need to adjust the find part to filter for only the files you are targeting.

Source Link
user1794469
  • 4.2k
  • 1
  • 27
  • 42

You can use find to get the files recursively and then sed to make the changes inline. This should work if I understand your goal correctly:

find . -name 'sed.c' -print0 | xargs -0 sed -i 's/%s/%d/g; s/bcm_errstr(rv)/rv/g;' 

Note: that this may match more than you want but you have pretty limited target behavior listed. You'll need to adjust the find part to filter for only the files you are targeting.