OS X - Make returning "Nothing to be done for <filename>" - macos

First of all, I would like to apologize if I'm on the wrong stackexchange network, and secondly, sorry if I'm overlooking something simple.
I was moving files from my old hard drive from an old PC when I came across several password protected ZIP Files. However, since those files were a bit old, I forgot the passwords already. I tried every password I could come up with but I still came up empty. After several google searches, I found this tool/utility for Mac OS X that could help me. So I go to the downloads page and download the Mac OSX utility tool and the source code.
However, I am having problems executing the make command for the file. It says on the downloads page:
If you are using linux or another unix, you need to download the source code, uncompress it and type "make" to compile the utility.
So far, what I've tried is
$make /Users/myname/Downloads/aapr-0.01-source/Makefile
I have also tried the other files in the source folder but nothing worked. After that, I'm pretty much blank. I tried double clicking the aapr file in the utility download for Mac (which is a Unix Executable) and it opens a new terminal window displaying the commands and such. Also, doing $aapr [options] [filename] only shows me -bash: aapr: command not found. I also updated XCodes command line tools.
Sorry if I'm missing out on something very basic, I don't usually use the terminal on the OS X.

Try running
cd /Users/myname/Downloads/aapr-0.01-source
make
A Makefile contains rules for building files from other files but it is based on paths and contents, etc. which depend on your current location. So generally you need to be in the directory of the project for it to work.
Edit (copied from my comment):
To execute a command from a specific location (that isn't in the normal $PATH) you need to specify a path for it. So something like /bin/bash or ./aapr (where ./ means the current directory).

Related

Creating a mac app which calls a shell script, but developing in ubuntu

I have a shell script, and a tarball. The shell script unpacks the tarball, and makes use of the files inside of for performing a task. I need to make this accessible on mac laptops, but in such a way that there is either a .app or .dmg file that when clicked, ultimately calls that shell script. I found several utilities, that can do this (create such an .app file), such as Platypus, or Appify. However, these require Mac to build the file. The thing is, I must package the .app/.dmg file, in an Ubuntu environment.
Is there any good software for creating a dmg or app file which call a shell script when clicked, but such that the software which can be run in Ubuntu (just for the purpose of creating the file)?
This is not an exact answer to your question but an workaround that might be acceptable if you can't find a better solution.
First, a zip file will automatically extract its content if you double click it in OS X so
tar -cvzf your_filename.zip ...
would create a file that can be easily extracted.
Secondly, if you create a shell script that has the extension .command, but otherwise is like any shell script, it can be run from OS X by double clicking on it (by opening a terminal and executing it there), it would mean an extra manual step for the user but like I said, this is a workaround :)
If you create a .command file, remember to make it executable.

Mac OSx 7zcat command not found

I am trying to execute a Makefile script and my Mac complains about 7zcat, although I already have 7z installed.
/bin/sh: 7zcat: command not found
Any thoughts on what's missing on my system? Thank you!
I have never used 7zcat before.
However, it looks like it needs to be installed on your system.
https://github.com/essentialkaos/7zcat
Also, after you download install 7zcat you have to give it execute permission with chmod. Finally, you have to execute it by calling its full path for example if you installed it to the directory you are in you would run ./7zcat file.7z or you would add the path to the file to your environment's $PATH variable.
I hope this helps. You might have to do some more research though.
When you open a Terminal window and type 7zcat and hit enter, what happens? Same message? Well, if you cannot use it, why should make be able to use it? Where and how have you installed 7z? Is the folder with the 7z binaries in your PATH? Since if it isn't, of course the command won't be found.
When the system shall run a command, it will search for this command in the directories stored in the PATH variable. Execute echo $PATH in terminal and you will get a colon separated list of directories; only these directories are searched for binaries. So either you must move your binaries to one of these (or put a symlink to one of these) or add the directory with these binaries to the PATH.
Yet there is no official 7z command line installer for MacOS, which brings me back to the original questions "Where and how have you installed 7z?" And are you sure that whatever you installed even includes a 7zcat?

TCL file not found by NS2 in MAC OS X Mavericks

I have just installed NS2 on Mac OS X Mavericks (10.9)
I have set all the paths correctly.
I can successfully type 'ns' on the terminal, and 'nam' as well, and both execute without any problem.
The problem is that when I input a file to the ns command, it says:
couldn't read file "example.tcl": no such file or directory
I use this command in the terminal:
ns example.tcl
I also tried it running it in sudo mode:
sudo -s
ns example.tcl
I placed the file in the bin folder, where there's ns's shortcut, I also placed it where actually the ns is. I also tried giving it a full path to the tcl file, but no use in both the cases.
I also tried to run it after executing only ns first, and then within ns ran it (No idea if it works like this, I am just trying everything I have got!)
ns
%ns example.tcl (Hash sign shows the NS is running and I am typing the command there)
This time the error is:
warning: using backward compatibility mode
error when calling class OldSim: hello-ddos.tcl
The version of NS is 2.35.
NOTE: I changed the file extension from .tcl to .txt, and it works fine now. Any idea of the problem?
Please help!
The error message:
couldn't read file "example.tcl": no such file or directory
is pretty clear. It simply couldn't find the file; the OS returned an ENOENT error from the underlying system call to open the file. The usual reason for this is that the file isn't in the directory that you're running the program from, and the usual recommendation for dealing with this is to use the full name of the file instead of just the local path-less version. (It's technically possible for there to be other issues, but they usually produce different errors.)
What can cause this? Well, one of the most common things is if you (or some library code, such as what is inside NS2) does a cd to change the current directory. Using a full, absolute filename makes (or at least should make) your code much more resistant to that sort of thing.
Warning: note that the second part of your question relating to changing the filename is strange to me.
Check the directory of your file. It should be in the bin folder inside your ns folder.
Also you may try typing
sudo ./ns filename.tcl
to give you root access if by any chance you are detached from that.

How do you get your path in Octave (on Windows)?

I used addpath(pwd) to get my .m files working in my projects directory. When I close the window and start a new window, the path I just added is gone. But the files still run.
Is it in my path or not? How do I see the directories I have added to my path?
Also, . is the first entry I see from path. Does that mean I don't need to add any directories because it will always search the current directory first?
Thanks.
Basically, yes.
You can add a directory to the search path using addpath(), but as you know, it only exists for the current session and is reset when you restart Octave. If you want a path to survive between sessions, add it to your octaverc, a script file that gets run whenever a new session gets started. Example path to octaverc file is:
C:\Octave\3.2.4_gcc-4.4.0\share\octave\site\m\startup
Since . is in your path by default, Octave will search your current directory for any function files that it needs. Using addpath(pwd) is somewhat useless if you're just going to stay in the same directory. However, there are some cases where it'd be useful, if for example you have a directory that contains your functions, and another one that has the data that you're working on: you could start in the functions directory, do addpath(pwd), and then cd to the data directory while still being able to use your functions.
You can create batch file, which will start Octave with your directory path. Please see example below:
octave-3.6.4.exe -p "C:\MyOctaveDiretory"
-p means addpath()
addpath(pwd); savepath();
Done.
I think there is a bug in Octave (I use version 4.0.3 on Windows). When I create a new file in current path, this can't be called by Octave ("error: 'foo' undefined near line 1 column 1"). If I restart Octave, it works. This addpath(pwd) trick helps me a lot (before I unsuccessfully tried rehash() and cd elsewhere and back again).
If you had the same problem, the reason for the symptom might be:
Start Octave.
Create newfile.m.
Call newfile - fails since Octave did not register its existence.
addpath(pwd) - causes Octave to register it.
Close Octave
Start Octave - now pwd is gone from path, but newfile.m is registered at startup.
call newfile - works
I faced a similar problem in adding path where the path was added by using addpath command directly in Octave GUI (Command Window). The path added was being shown in console window but none of the functions worked.
The problem was solved by changing the path directory from Windows directory to some other direction where OS is not installed.

Is there a way to save a file in vim in Windows without marking it executable?

Heading says it all really. Using Windows 7 and latest stable gvim, whenever I save (:w) a file it's marked executable. I'm doing cross-platform development and it'd be nice if this didn't happen.
#sceptics: The flag of the files are indeed set as executable. Do a ls -al before and after re-saving the file to observe the issue. (install cygwin, or may be other *nix emulations)
#OP: the question have been raised several times in the past. I don't remember the conclusion on the subject. You should search vim mailing-lists archives (vim_use and vim_dev).
May be you can try to add an hook to your RCS (if it supports that) to proceed to a chmod -x on file extensions that does not correspond to an executable (*.h, *.cpp, *.vim, ...), or on files that do not contain a shebang (unlike perl, I don't know if python source files may contain a shebang)

Resources