Using sed to append backward slash before forward slash

Hi all,

I need to know way of inserting backward slash before forward slash. My problem is that i need to supply directory path as an argument while invoking cshell script. This argument is further used in script (i.e. sed is used to insert this path in some file). So i need to place \ in front of / in path.

I am thinking of saving path supplied as argument in some variable and then processing that variable before it is supplied to sed. Can any one suggest me way of finding & inserting \. Please try to answer with csh & sed ass refernce as my script is in cshell.

-Sarbjit

sed 's./.\\/.g'

Top Ten Reasons not to use the C shell
Csh problems
Csh Programming Considered Harmful

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.

---------- Post updated at 10:30 ---------- Previous update was at 10:29 ----------

Continued here