do not escape \ in --line
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
		
					parent
					
						
							
								71e5314ec1
							
						
					
				
			
			
				commit
				
					
						f8c36c080e
					
				
			
		
					 1 changed files with 9 additions and 1 deletions
				
			
		|  | @ -49,7 +49,15 @@ case "$state_should" in | ||||||
|         # Replace all \ so \t and other combinations are not interpreted |         # Replace all \ so \t and other combinations are not interpreted | ||||||
|         # |         # | ||||||
| 
 | 
 | ||||||
|         line_sanitised=$(cat "$__object/parameter/line" | sed -e "s/'/'\"'\"'/g" -e 's/\\/\\\\/g') | 
 | ||||||
|  |         # line_sanitised=$(cat "$__object/parameter/line" | sed -e "s/'/'\"'\"'/g" -e 's/\\/\\\\/g') | ||||||
|  |         # The one above does not work: | ||||||
|  |         #     --line "PS1='[\t] \[\033[1m\]\h\[\033[0m\]:\w\\$ '" | ||||||
|  |         # becomes | ||||||
|  |         # PS1='[\\t] \\[\\033[1m\\]\\h\\[\\033[0m\\]:\\w\\$ ' | ||||||
|  | 
 | ||||||
|  |         # Only replace ' with '"'"' and keep \ as they are | ||||||
|  |         line_sanitised=$(cat "$__object/parameter/line" | sed -e "s/'/'\"'\"'/g") | ||||||
|         echo "printf '%s\n' '$line_sanitised' >> $file" |         echo "printf '%s\n' '$line_sanitised' >> $file" | ||||||
| 
 | 
 | ||||||
|     ;; |     ;; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue