
file contents into shell/env variable
Hello, can you show me a simple way to read a file into a shell/env
variable?
What I intended to do is read the .signature file into MAILX_TAIL
variable, so that I can use the same signature in elm and Mail (I'm
using solaris 2.5). My error history (in csh):
% set x=`cat .signature` # no, shell breaks it into words
% set x="`cat .signature`" # no, it's broken into lines
% set dollar='$'
% set x="`cat .signature | sed -e 's/$dollar/\\/'`"
(I was trying to replace the newline with backslash-newline. nope,
didn't work as the leading spaces are thrown out)
It was easy in sh:
$ IFS=''
$ set `cat .signature`
$ MAILX_TAIL=$1
Then how can I wrap around the shell command so that I have the right
value of MAILX_TAIL in csh ?
Thanks in advance,
--WG.