linux - Plink > didn't return newline carriage -


this supposed basic. i'm running plink windows , want output file plink 192.168.229.128 -ssh -l root -pw password runsql.sh > result.log

the runsql.sh output like

121211212 213212312 434234234 521312312 

however result.log shows as:

121211212213212312434234234521312312 

how can fix this? bunch!

you seem have opened unix line ending file in notepad.exe or low-end editor, not understand line endings.

if going check result in manner, can try adding @ start of script:

[ "$ssh_connection" -a  ! -t 1 ] && exec 1> >(sed 's/$/\r/') 

note there should better & more robust mechanism detect output being redirected on ssh session.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -