OSX Touch Command - broken?

This seems like a silly question, but my team touchseems to have broken. Trying to create a file ~/.bash_profileusing the command: touch ~/.bash_profileand see the following when I send the command: -bash: touch: No such file or directory.I was looking for a little answer, but have not yet found the same problem. Can anyone help? What exactly do I need to do to make the touch command work?

+4
source share
2 answers

You might have wanted to run a command touchusing the OS X equivalent strace(I think this command exists on OS X, in fact, although there seem to be others), look at the output and see if there are any errors. Inserting products into pastebin may also be a good idea.

I think this is one of those cases where a call strerror()inside the touchC code refers to an insane value errno. (This is where all the “Execution <X>: Success” error messages come from . An error occurred, but after that it errnowas set to 0using a successful command before it errnowas fixed, and the error message was printed.)

+4
source

OS X Mavericks, Kornshell, bash:

:

$ touch foo

. . , :

$ touch /usr/bin/true
touch true: Permission denied

, , , , OP.

ln -s foo bar
touch bar

, . :

$ touch Applications

, .

:

$ sum /usr/bin/touch
6205 9 /usr/bin/touch
$ file /usr/bin/touch
/usr/bin/touch: Mach-O 64-bit executable x86_64

Mavericks, , .

+1

All Articles