Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7615407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:38:16+00:00 2026-05-31T02:38:16+00:00

Run this at a KornShell (ksh): echo ${MYVAR} | sed ‘s/\//\\/g’ It works fine

  • 0

Run this at a KornShell (ksh):

echo ${MYVAR} | sed 's/\//\\/g'

It works fine if MYVAR is //myserver/myshare
But doing the same and trying to put it into a variable and it fails with
sed: newline or end of file found in pattern

UNCVAR=`echo ${MYVAR} | sed 's/\//\\/g'`

How do I properly convert this path from the UNIX style slashes to the windows style slashes?

Important sample data:

//QFLELSAMPLE/reports
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:38:17+00:00Added an answer on May 31, 2026 at 2:38 am

    Yet another reason to stop using backticks (unless you plan to be using the Bourne Shell on Solaris/HP/et.al.) Backticks are deprecated according ‘The New Kornshell programming Language’, published in 1995!

    MYVAR="//myserver/myshare"
    UNCVAR=$(echo ${MYVAR} | sed 's/\//\\/g')
    echo "$UNCVAR"
    \\myserver\myshare
    

    Notice that I’m using the $( cmd ) version of command substitution.

    I hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

when I run this JS in FF or Safari it works just right but
How do I run this command with subprocess? I tried: proc = subprocess.Popen( '''ECHO
I run this script: define('SECRET', vJs;ly-W\XDkD_2'-M7S2/ZRRBobxt5); echo sha1(SECRET . 'zcbkeyky' . 'aaa@bbb.com') . \n;
I need to pass a list to a KornShell (ksh) function, something like this:
I run this code using both gpp and microsoft compiler but in both case
I run this code in MATLAB but it returns a Cyan frame obj =
I want a command line option like this one in the following KornShell (ksh)
I am writing a shell script to run under the KornShell (ksh) on AIX.
When I run this in Chrome (ver 2), it doesn't return the string, but
i run this and i want to fill textbox txtFname with data - but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.