سؤال

I am not familiar with sed. Now I came accross the following line in a shell script:

sed 's|'`pwd`'||'

what does the line do? Does it replace || with something else?

هل كانت مفيدة؟

المحلول

it removes any string that equals to current-working-directory in the input. because pwd may itself contain / instead of /, | used in sed command as pattern-delimiter.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top