0

I made an Unix command, macmac2unix, which converts Mac's Word file for Unix platforms.

I would like to run the command as

$macmac2unix file1 file2 file3 ...

Problem: How can I run this command in every path?

I added the following to .bashrc unsuccessfully

CDPATH=:/Users/Sam/Documents/Unix
2
  • 1
    Why are you doing this? There's no need for a conversion in OSX - its text files use UNIX CRLFs. Commented Mar 6, 2009 at 16:49
  • You are confusing CDPATH with PATH. And I also ask, why are you doing this, or could you clarify what exactly you are trying to do? Commented Mar 6, 2009 at 17:48

3 Answers 3

5

Try adding

export PATH=$PATH:/Users/Sam/Documents/Unix

to your .bashrc

Make your script executeable be sure it's located in /Users/Sam/Documents/Unix. You could reread your .bashrc with:

~> . ~/.bashrc

But if you already played around with your enviroment variables a restart of your terminal would be cleaner.

Sign up to request clarification or add additional context in comments.

3 Comments

Hm, remove the line 5 and restart your terminal. Or try executing 'export PATH=$PATH:/Users/Sam/Documents/Unix' directly in your terminal for testing purposes.
It seems to work. I get the following error: -bash: /Users/Sam/Documents/Unix/macmac2unix: Permission denied
I get the program work by running:$ chmod +x macmac2unix . Thank you!
3

Add it to PATH, not CDPATH.

Comments

2

Try adding it in PATH like this:

PATH=/Users/Sam/Documents/Unix:$PATH

Comments

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.