0

I am trying to delete a file from a SAS program. The Unix commands I want to run are:

unalias rm;

rm -f &file..txt;

How do I do this? I tried using the 'x' statement, but can't get it to work. I need the commands to run in the same shell for unalias to work AND I need the macro variable to resolve.

1 Answer 1

2

You can use semi-colon (;) to separate multiple commands in one command string.

x "unalias rm; rm -f &file..txt";

In general I just use a leading backslash to force Unix to NOT use the alias for command.

x "\rm -f &file..txt";
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! I had tried to do something like your first suggestion, but couldn't get it to work. My situation is actually a little more complicated because I am also using a wildcard (*), which might be why I was having trouble. Using a backslash works perfectly though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.