Search Results

Search: Posts Made By: injey
19,384
Posted By gary_w
SQL/Plus in a coprocess example. Also saves query results into shell variables
While assisting a forum member, I recommended running SQL/Plus in a coprocess (to make database connections and run a test script) for the duration of his script rather than starting/stopping it once...
8,618
Posted By rdcwayx
replace echo by printf Sample for you. printf...
replace echo by printf
Sample for you.
printf "%s \002 %s \002" ${name} ${age}
8,618
Posted By fpmurphy
name="Adam Smith" age=40 printf "%s\002%s"...
name="Adam Smith"
age=40

printf "%s\002%s" "${name}" "${age}" > outfile
xxd -a outfile
14,486
Posted By Scrutinizer
Or: awk -F^B '{print $2}' infile Where ^B...
Or:

awk -F^B '{print $2}' infile
Where ^B is entered as CTRL-V CTRL-B

In bash/ksh93 you can do this:
awk -F$'\002' '{print $2}' infile
Note: \002 is octal
14,486
Posted By Chubler_XL
My bad, looks like some versions of awk don't...
My bad, looks like some versions of awk don't support the 0x02 format, try 2 instead:

$ awk 'BEGIN {FS=sprintf("%c", 2)} {print $2}' sample

By the way od -c is nice to debug this sort of...
Showing results 1 to 5 of 5

 
All times are GMT -4. The time now is 02:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy