dos-path / un-dos-path compatibility with cygwin


 
Thread Tools Search this Thread
Operating Systems Linux dos-path / un-dos-path compatibility with cygwin
# 1  
Old 02-17-2009
dos-path / un-dos-path compatibility with cygwin

Hello ;
I have a problem running some script on dos .

when i run :
C: ls /temp
ls: cannot access /temp: No such file or directory


but when i run
C: ls \temp
windriver backup remotebackup

also when i run
C: ls temp
windriver backup remotebackup

The problems that i have all developpers scripts was written first like this example ls /dir1 or cp /dir2 , we canno't change all scripts.

So i want to solve this problems to get these scripts running

please could you give to solve this problems .

Thanks

Mulder
# 2  
Old 02-18-2009
hello ,
please have you any advices about this problems ,

ls /tmp
no such file or directory

ls \tmp
dir1 dir2 dir3

Thanks for your help,
# 3  
Old 02-19-2009
have someone any idea or suggestions about compatibilities between (cygwin-path /) and (dos-path \)

thanks
# 4  
Old 02-26-2009
There isn't a magic way to make the windows command prompt suddenly use / instead of \, it's a hardcoded thing that's been that way for 20 years. Windows understands both \ and /, but since / usually means commandline options, most windows commandline programs will refuse to accept a path that uses /'s.

If there are too many scripts to change by hand, you may wish to use automated tools like sed to convert / to \. Be careful to only convert the relevant forward-slashes.
# 5  
Old 02-26-2009
The thing is

ls \temp or ls temp specify a relative path, ie search in the current directory for temp and list the items

ls /temp specifies an absolute path from the root! ie / so you are asking him a completely different thing. If you want the temp on your c drive, you need to specify /cygdrive/c/temp !!


Or, just do as Corona688 says, and push 'man sed' or man tr
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies

2. UNIX for Advanced & Expert Users

Command to see the logical volume path, device mapper path and its corresponding dm device path

Currently I am using this laborious command lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}' Would like to know if there is any shorter method to get this mapping of... (2 Replies)
Discussion started by: royalibrahim
2 Replies

3. Shell Programming and Scripting

Moving files from parent path to multiple child path using bash in efficient way

Hi All, Can you please provide some pointers to move files from Base path to multiple paths in efficient way.Folder Structure is already created. /Path/AdminUser/User1/1111/Reports/aaa.txt to /Path/User1/1111/Reports/aaa.txt /Path/AdminUser/User1/2222/Reports/bbb.txt to... (6 Replies)
Discussion started by: karthikgv417
6 Replies

4. Windows & DOS: Issues & Discussions

DOS bat file to add to path

This may not be the right place, since it is not exactly unix or linux, but it does involve cygwin. I have two cygwin installations. When I start a mintty terminal, I need to toggle a windows path variable to make sure that the correct cygwin dll gets loaded. I need to add C:\cygwin\bin to the... (3 Replies)
Discussion started by: LMHmedchem
3 Replies

5. Windows & DOS: Issues & Discussions

Avoiding DOS space related "path not found errors"

Well I have a lot of scripts that require dragging and dropping files in order to define Source files etc. However more often then not it is the case that the path to said file contains NUMEROUS spaces. I know one way to evade this problem is to encase the path in Quotes like this: ... (7 Replies)
Discussion started by: pasc
7 Replies

6. Windows & DOS: Issues & Discussions

DOS Dir - listing of full path and timestamp

Hi, (Apologies, I'm sure I'm not the first person to raise this question but so far in my searches haven't found a good answer). I would like to output a listing per line of filename (including full path) and 'last updated' timestamp. e.g: Z:\dir1\file1.txt 01/02/2010 10:43... (5 Replies)
Discussion started by: GM_AIX
5 Replies

7. UNIX for Advanced & Expert Users

accessing NFS absolute path symlinks from windows/cygwin

Hi experts, I was wondering if there is a way to access some NFS symlink files that are set using absolute paths from Windows? On windows/cygwin, I'm able to access relative path symlinks but not the absolute path symlinks. Assume on Linux (mylinux): /usr/local/file.c ln -s... (1 Reply)
Discussion started by: andredz
1 Replies

8. Windows & DOS: Issues & Discussions

how to return cygwin output to DOS

Hi, I have installed cygwin on my windows XP system. And I am trying to use the following code snippet: set SERVER="grep JDBCConnectionPool config.xml | gawk -F; '{print $2}'" sed -i 's/%SERVER%/WLMDEVDB1/' config.xml But it doesn't work because at runtime %SERVER% gets replaced by "grep... (2 Replies)
Discussion started by: illcar
2 Replies

9. Shell Programming and Scripting

Executing Commands From Non-Standard Path (Changing user's PATH secretely???)

Hi: I have a requirement as below: I have some standard Unix commands modified and kept them in a directory say /usr/clsh/bin. For example I have a script named "ls" kept here which is modified version of "ls" (say it always gives long listing i.e. ls -l). When any user logs on and types... (2 Replies)
Discussion started by: ramesh_samane
2 Replies

10. Windows & DOS: Issues & Discussions

compatibility cygwin / with dos-path

when i run in dos for example: C: ls /temp ls: cannot access /temp: No such file or directory but when i run C: ls \temp windriver backup remotebackup also when i run C: ls temp windriver backup remotebackup The problems that i have all developpers scripts was written first like this... (0 Replies)
Discussion started by: mulder20
0 Replies
Login or Register to Ask a Question