[ale] OT: Help with _funky_ characters in bash script

Fletch fletch at phydeaux.org
Wed Jul 9 10:42:12 EDT 2003


>>>>> "Jeff" == Jeff Layton <jeffrey.b.layton at lmco.com> writes:


[...]

    Jeff> WORKSIZE=`ls -lsa ${WORKDIR}/${CASEPROJ}.urest | awk '{print
    Jeff> $1}' `

    Jeff> to a file (I hope these characters some through correctly :)
    Jeff> Does anybody have a way to echo all of this line, including
    Jeff> the _funky_ characters, to a file?

Aside from the obvious . . .

#!/usr/bin/perl
open( OUT, ">" . shift() ) or die "can't open output: $!\n";
print OUT <<'EOT';
WORKSIZE=`ls -lsa ${WORKDIR}/${CASEPROJ}.urest | awk '{print $1}'`
EOT
close( OUT );
exit 0;
__END__


You could just quote them . . .

echo 'WORKSIZE=`ls -lsa ${WORKDIR}/${CASEPROJ}.urest | awk '"'"{print \$1}"'"'`' > fooble


-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
770 294-0820 (m)      |  scary questions." -- Jules                =(___)=
                      |                                               U
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale





More information about the Ale mailing list