Skip to content
Advertisement

Tag: substitution

Non-dash related bad substitution error

I am trying to write a bash script performing to find and pull somewhere else a specific file type. So far, I came up with the following script: find ./to_compress -type f -iname “*.tar” -mindepth 1 -maxdepth 1 -exec mv {} ./compressed/${{}##*/} However the bash complains that ${{}##*/} is a bad substitution bash: ./compressed/${{}##*/}: bad substitution Some googling around suggested

How to substitute text which has implicit meaning in vi

I have a C code in vi from which I want to replace the text “n” with something else. Use of %s:n:(anything else) isn’t working. Is there any way to bypass this? For example,a line in the code is: printf(“Hello worldn”); In vi, I need to replace “n” in the printf line with a full stop. Use of substitue command

Advertisement