sed
can use any separator instead of /
in the s
command. Just use something that is not encountered in your paths:
s+AAA+BBB+
and so on.
Alternatively (and if you don’t want to guess), you can pre-process your path with sed to escape the slashes:
pwdesc=$(echo $PWD | sed 's_/_\\/_g')
and then do what you need with $pwdesc
.
Related Contents:
- Why does sudo change the PATH? [closed]
- How to change the Jupyter start-up folder
- How to add a folder to `Path` environment variable in Windows 10 (with screenshots)
- How to add include path in Qt Creator?
- How do I include a path to libraries in g++
- How to create multiple output paths in Webpack config
- Windows 7 – Add Path
- How to get folder path from file path with CMD
- So what IS the right direction of the path’s slash (/ or \) under Windows?
- Dump include paths from g++
- How to add a set path only for that batch file executing?
- Does MAX_PATH issue still exists in Windows 10
- How do you install an MSI with msiexec into a specific directory?
- Escape a string for a sed replace pattern
- How to delete from a text file, all lines that contain a specific string?
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- How to get CRON to call in the correct PATHs
- How to insert strings containing slashes with sed? [duplicate]
- How to get an absolute file path in Python
- pip freeze creates some weird path instead of the package version
- How to get rid of double backslash in python windows file path string? [duplicate]
- Test if executable exists in Python?
- Open file in a relative location in Python
- How to extract text from a string using sed?
- Recursively rename files using find and sed
- Insert contents of a file after specific pattern match
- Python: Platform independent way to modify PATH environment variable
- Passing two command parameters using a WPF binding
- How to insert a text at the beginning of a file?
- Edit shell script while it’s running
- Shell variables in sed script
- sed or awk: delete n lines following a pattern
- How can I troubleshoot Python “Could not find platform independent libraries “
- How to animate a path on an Android Canvas
- Replace a word with multiple lines using sed?
- Add text at the end of each line
- Maximum length of command line argument that can be passed to SQL*Plus?
- Sed to extract text between two strings
- How to get full path of a file?
- How should I write a Windows path in a Python string literal?
- How to get only the last part of a path in Python?
- How can i get the path of the current user’s “Application Data” folder?
- How to remove double-quotes in jq output for parsing json files in bash?
- Insert multiple lines into a file after specified pattern using shell script
- What’s wrong with my lookahead regex in GNU sed?
- Windows PATH to posix path conversion in bash
- Removing Windows newlines on Linux (sed vs. awk)
- Expand variables in sed
- PATH not updated correctly from conda activate in VSCode’s terminal
- xcrun: error: active developer path (“/Applications/Xcode.app/Contents/Developer”) does not exist