Can i change the behavior of \

Can i change the behavior of \

Post by Guy Roussi » Thu, 24 Jan 2002 19:07:57



Hi,
I'm loose with all this \ in my script.
How can i modify the behavior of \ ?
Thanks
Guy Roussin

This is an extract of my script (test2.sh)
(note the high number of \)
------------------------------------
#!/bin/sh

SCRIPT="./test.bat"
exec 1>"$SCRIPT"
HOMEDIR="\\\\\\host\\\\user"
write "echo $HOMEDIR"
------------------------------------

# ./test2.sh
# cat ./test.bat
echo \\host\user

--

 
 
 

Can i change the behavior of \

Post by Alex » Thu, 24 Jan 2002 19:31:49


try this.

#!/bin/sh

SCRIPT="./test.bat"
exec 1>"$SCRIPT"
HOMEDIR= '\\\\\\host\\\\user'
write $(echo $HOMEDIR)

Is that what you mean ???



> Hi,
> I'm loose with all this \ in my script.
> How can i modify the behavior of \ ?
> Thanks
> Guy Roussin

> This is an extract of my script (test2.sh)
> (note the high number of \)
> ------------------------------------
> #!/bin/sh

> SCRIPT="./test.bat"
> exec 1>"$SCRIPT"
> HOMEDIR="\\\\\\host\\\\user"
> write "echo $HOMEDIR"
> ------------------------------------

> # ./test2.sh
> # cat ./test.bat
> echo \\host\user

> --


 
 
 

Can i change the behavior of \

Post by Guy Roussi » Thu, 24 Jan 2002 20:02:59


Hi Alex,

This is what i get with your proposal (under solaris 8):
./test.sh
./test.sh: \\\\\\host\\\\user: not found
./test.sh: syntax error at line 6: `(' unexpected

I want to write something like
HOMEDIR="\\host\user"
write "echo $HOMEDIR"
and get this on test.bat :
echo \\host\user

Thanks,

Guy


> try this.

> #!/bin/sh

> SCRIPT="./test.bat"
> exec 1>"$SCRIPT"
> HOMEDIR= '\\\\\\host\\\\user'
> write $(echo $HOMEDIR)

> Is that what you mean ???



> > Hi,
> > I'm loose with all this \ in my script.
> > How can i modify the behavior of \ ?
> > Thanks
> > Guy Roussin

> > This is an extract of my script (test2.sh)
> > (note the high number of \)
> > ------------------------------------
> > #!/bin/sh

> > SCRIPT="./test.bat"
> > exec 1>"$SCRIPT"
> > HOMEDIR="\\\\\\host\\\\user"
> > write "echo $HOMEDIR"
> > ------------------------------------

> > # ./test2.sh
> > # cat ./test.bat
> > echo \\host\user

> > --

 
 
 

Can i change the behavior of \

Post by Alex » Thu, 24 Jan 2002 20:43:03


hi,
I executed it with bash. With sh hier is a small correction: please no
whitspace after =

#!/bin/sh

SCRIPT="./test.bat"
exec 1>"$SCRIPT"
HOMEDIR='\\\\host\\user'
write "echo $HOMEDIR"

and personal i will do it like this:
#!/bin/sh
SCRIPT="./test.bat"
exec 1>"$SCRIPT"
HOMEDIR='\\\\host\\user'
printf  "echo $HOMEDIR"

please tell me if it works under solaris 8.

 
 
 

Can i change the behavior of \

Post by Alex » Thu, 24 Jan 2002 20:42:19


hi,
I executed it with bash. With sh hier is a small correction: please no
whitspace after =

#!/bin/sh

SCRIPT="./test.bat"
exec 1>"$SCRIPT"
HOMEDIR='\\\\host\\user'
write "echo $HOMEDIR"

and personal i will do it like this:
#!/bin/sh
SCRIPT="./test.bat"
exec 1>"$SCRIPT"
HOMEDIR='\\\\host\\user'
printf  "echo $HOMEDIR"

please tell me if it works under solaris 8.



Quote:> Hi Alex,

> This is what i get with your proposal (under solaris 8):
> ./test.sh
> ./test.sh: \\\\\\host\\\\user: not found
> ./test.sh: syntax error at line 6: `(' unexpected

> I want to write something like
> HOMEDIR="\\host\user"
> write "echo $HOMEDIR"
> and get this on test.bat :
> echo \\host\user

 
 
 

Can i change the behavior of \

Post by Alex » Thu, 24 Jan 2002 20:43:53


hi,
I executed it with bash. With sh hier is a small correction: please no
whitspace after =

#!/bin/sh

SCRIPT="./test.bat"
exec 1>"$SCRIPT"
HOMEDIR='\\\\host\\user'
write "echo $HOMEDIR"

and personal i will do it like this:
#!/bin/sh
SCRIPT="./test.bat"
exec 1>"$SCRIPT"
HOMEDIR='\\\\host\\user'
printf  "echo $HOMEDIR"

please tell me if it works under solaris 8.



> Hi,
> I'm loose with all this \ in my script.
> How can i modify the behavior of \ ?
> Thanks
> Guy Roussin

> This is an extract of my script (test2.sh)
> (note the high number of \)
> ------------------------------------
> #!/bin/sh

> SCRIPT="./test.bat"
> exec 1>"$SCRIPT"
> HOMEDIR="\\\\\\host\\\\user"
> write "echo $HOMEDIR"
> ------------------------------------

> # ./test2.sh
> # cat ./test.bat
> echo \\host\user

> --

 
 
 

Can i change the behavior of \

Post by Guy Roussi » Thu, 24 Jan 2002 21:59:15


Alex,

Yes, it works fine under solaris 8 now but my problem
isn't completely solved ...
in fact in my real script i use something like
USER="guy"
HOMEDIR="\\\\\\host\\\\$USER"
So i can't really use
HOMEDIR='\\\\host\\$USER'

Note that the write() function append a CRLF : chr(13)&chr(10)
at the end of the line (a batch for DOS ...)

Thanks
Guy


> hi,
> I executed it with bash. With sh hier is a small correction: please no
> whitspace after =

> #!/bin/sh

> SCRIPT="./test.bat"
> exec 1>"$SCRIPT"
> HOMEDIR='\\\\host\\user'
> write "echo $HOMEDIR"

> and personal i will do it like this:
> #!/bin/sh
> SCRIPT="./test.bat"
> exec 1>"$SCRIPT"
> HOMEDIR='\\\\host\\user'
> printf  "echo $HOMEDIR"

> please tell me if it works under solaris 8.



> > Hi,
> > I'm loose with all this \ in my script.
> > How can i modify the behavior of \ ?
> > Thanks
> > Guy Roussin

> > This is an extract of my script (test2.sh)
> > (note the high number of \)
> > ------------------------------------
> > #!/bin/sh

> > SCRIPT="./test.bat"
> > exec 1>"$SCRIPT"
> > HOMEDIR="\\\\\\host\\\\user"
> > write "echo $HOMEDIR"
> > ------------------------------------

> > # ./test2.sh
> > # cat ./test.bat
> > echo \\host\user

> > --

 
 
 

Can i change the behavior of \

Post by Eric Amic » Thu, 24 Jan 2002 23:26:54



> Alex,

> Yes, it works fine under solaris 8 now but my problem
> isn't completely solved ...
> in fact in my real script i use something like
> USER="guy"
> HOMEDIR="\\\\\\host\\\\$USER"
> So i can't really use
> HOMEDIR='\\\\host\\$USER'

Then use

HOMEDIR='\\\\host\\'"$USER"

instead.  Nothing requires you to put the entire value in a single set of
quotes.

--
Eric Amick
Columbia, MD

 
 
 

Can i change the behavior of \

Post by Guy Roussi » Fri, 25 Jan 2002 00:37:49


Thank you Eric,
Thank you Alex,

Guy



> > Alex,

> > Yes, it works fine under solaris 8 now but my problem
> > isn't completely solved ...
> > in fact in my real script i use something like
> > USER="guy"
> > HOMEDIR="\\\\\\host\\\\$USER"
> > So i can't really use
> > HOMEDIR='\\\\host\\$USER'

> Then use

> HOMEDIR='\\\\host\\'"$USER"

> instead.  Nothing requires you to put the entire value in a single set of
> quotes.

> --
> Eric Amick
> Columbia, MD


 
 
 

1. changes in vi behaviour overnight, no change on my part

This morning, when I came in, vi suddenly stopped responding to the
up/down/left/right arrows and forced me to use "h","j","k","l". I am
mystified about how this happened, but would like to know a strategy for
ferretting out what is wrong and (possibly) how it happened. That is, I
need to 1) correct the problem, and 2) understand how it occurred. Can
someone give me some pointers on how to proceed? The platform is a Sun,
Solaris 2.5, and it has been quite stable for a long, long, time.
Thanks in advance.
And can you reply directly, since following this newsgroup on the IBM
mainframe is particularly difficult.
Thanks again.
Carl David

2. HELP YAMAHA YMF715E-S

3. It's not bad canned meat...

4. empty /var/adm/messages

5. Searching for symbolic/hard links

6. Canned Proxy URLs to Filter

7. Can I run Apache server on a single system, non-networked?

8. CGI: apache canned response

9. For those of you tired of canned distributions...

10. Canned "ping"

11. Any Canned Class code?

12. PPPD or Tin Cans: Which is Better?