- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
What I am struggling with is code to use in my PIPE command when my linux directory has spaces. I see various posts on SAS community that say to surround the path in double quotes, which I am doing. But I still get a path not found error. This is what I have for it. Any ideas? I am pulling my hair out on this 😊. I have tested the code below with a path without spaces, and it works. With spaces seems to be the issue. Thanks for any tips you can provide!
filename test pipe 'ls -a "/my path with spaces"';
ERROR: Physical file does not exist, /sso/biconfig/940/Lev1/SASApp/ls: cannot access
: No such file or directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@shl007 wrote:
Hello,
What I am struggling with is code to use in my PIPE command when my linux directory has spaces. I see various posts on SAS community that say to surround the path in double quotes, which I am doing. But I still get a path not found error. This is what I have for it. Any ideas? I am pulling my hair out on this 😊. I have tested the code below with a path without spaces, and it works. With spaces seems to be the issue. Thanks for any tips you can provide!
filename test pipe 'ls -a "/my path with spaces"';
ERROR: Physical file does not exist, /sso/biconfig/940/Lev1/SASApp/ls: cannot access
: No such file or directory.
The error message you posted makes it look like you forgot the PIPE engine since it looks like it is taking the ls as the filename.
Are you sure the path actually exists? Try just creating a fileref that points to that directory and see if it find the path. Or try using this macro to test if the directory exists: https://github.com/sasutils/macros/blob/master/direxist.sas
You could also try using Unix escape character (backslash) to protect the spaces.
filename test pipe 'ls -a /my\ path\ with\ spaces';