IRIX bash shell expands expression in single quotes, yet shouldnt -


In the shell, I have a single-quote and then the carriage return and then the row of one series and then a single-quote: / P> Root @ Objective: / Root & gt; '& Gt; @stat = lstat ($ ARGV [0]); & Gt; If (! @stat) {if (@stat = lstat ($ ARGV [0]);) {& gt; Print "blue \ n"; & Gt; Exit 0; & Gt; } & Gt; '

However, if you notice the output given from the shell:

  bash: @stat = lstat ($ ARGV [0]); If (@stat = lstat ($ ARGV [0]);) {print "zero \ n"; Exit 0; }: Command not found root @ Objective: / root & gt; Uname -i IRIX64 Objective 6.5 04091957 IP27 Root @ Objective: / Root & gt; Echo $ 0 -bash root @ aim: / root & gt;  

You note that ! @ Stat is converted to @stat = lstat ($ ARGV [0]);

How should the following shell program be written so that the Perl program is interpreted literally?

  tramp_perl_file_attributes () {\ perl -e '@stat = lstat ($ ARGV [0]); If (! @stat) {print "zero \ n"; Exit 0; } If (($ stat [2] and 0170000) == 0120000) {$ type = readlink ($ ARGV [0]); $ Type = "\" $ type \ ""; } Elsf (($ stat [2] and 0170000) == 040000) {$ type = "t"; } And {$ type = "zero"}; $ Uid = ($ ARGV [1] EQ "Integer")? $ Stat [4]: ​​"\" "getpwuid ($ stat [4])." "$ Gid = ($ ARGV [1] EQ" Integer ") $ Stat [5]:" \ "" getgrgid ($ stat [5]). "" \ ""; Printf ("(% s% u% s% s (% u% u) (% u% u) (% u% u)% u.0% ut (% u% -1) \ n", $ Type, $ stat [3], $ uid, $ gid, $ stat [8]> 16 & amp; 0xffff, $ stat [8] and 0xffff, $ stat [9]> 16 & Amp; 0xffff, $ stat [9] & amp; 0xffff, $ stat [10] & gt; 16 & amp; 0xffff, $ stat [10] & amp; 0xffff, $ stat [7], $ stat [2], $ Stat [1]> Gt; 16 & amp; 0xffff, $ stat [1] and 0xffff); '' $ 1 "" $ 2 "}  

For some reason, ! has been extended from history (extends to the last command you typed on the command line), which should not be between single quotes.


Comments