Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSX Touch Command -- Broken?

Tags:

bash

macos

This feels like a silly question, but my touch command seems to have broken. Trying to create the ~/.bash_profile file using the command: touch ~/.bash_profile and seeing the following when I send the command: -bash: touch: No such file or directory. I've search quite a bit for an answer but haven't found the same problem so far. Can anyone assist? What exactly do I need to do in order to make the touch command work?

like image 398
ccdrm Avatar asked Sep 28 '13 17:09

ccdrm


1 Answers

You might like to run the touch command through OS X's equivalent of strace (I think that command exists on OS X, actually, although there appear to be others), go through the output and examine what errors are generated, if any. Pasting the output to a pastebin may also be a good idea.

I think this is one of those instances where the call to strerror() inside touch's C code is referencing an insane value of errno. (This is where all those "Error performing <X>: Success" messages come from. There was an error, but errno subsequently got set to 0 by a successful command before errno was captured and the error message printed.)

like image 81
i336_ Avatar answered Sep 30 '22 00:09

i336_