Tag Info

New answers tagged

2

If it must be with echo "Kate", use awk: echo "Kate" | awk 'NR==FNR{a=$0;next} sub("Steven", a, $0)1' - file The standard input is Kate from echo "Kate", piped to awk. awk then reads the stdin (-). The condition NR==FNR is true when the first file is processes (stdin). The variable a is set to that value. Then the input of file is processed and sub() ...


6

sed 's:\\1\\:\ :g' file you will have to escape the backslashes in your match pattern. In the replacement, that's a backslash followed by a literal newline character. Some sed implementations, like GNU sed also support \n there as an non-standard alternative. Output "evSchema" "UAT" "evSN" "uadb" "evDirsep" "/" "evRootPath" "/work_area/APP_UAT/" ...



Top 50 recent answers are included