Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • [[:blank:]] is only space+tab in the C/POSIX locale. In other locales, it often matches a lot more (though not ASCII ones) Commented Jan 10, 2023 at 7:53
  • @kusalananda thank you so much!! That worked and I managed to rename all the dir paths in the file. I have a follow up question. is it possible to use wildcard or something for 1344P1052_ssl0 because in one text file, this directory path can be different. like 1589P1856_ssl9 and so forth. Commented Jan 11, 2023 at 6:35
  • 1
    @PritiPatel I showed how to combine the pattern for 1344P1052_ssl02 and 1344P1052_ssl09 into 1344P1052_ssl0[29]. If you want to allow for any two-digit integer, use 1344P1052_ssl[0-9][0-9]. If you want to allow for any integer regardless of how many digits (including no digits), use 1344P1052_ssl[0-9]*. Commented Jan 11, 2023 at 6:40
  • @Kusalananda sorry for the confusion. I meant the whole string 1344P1052_ssl09 regardless of its name and integer. I replaced 's|^1344P1052_ssl0[29] with 's|^* but that didn't work. Commented Jan 11, 2023 at 7:51
  • 1
    @PritiPatel s|.*[[:blank:]]/gs:/prod1/|sd://prod1-backup/| Commented Jan 11, 2023 at 7:53