I've tried using the following commands to run my .bin file I have saved on my desktop. I'm able to navigate and run it using;
cd desktop
chmod +x ./two1.bin
./two1.bin
(two1.bin being the name of the file)
When it runs it displays each line in the terminal window and says "command not found" after it reads the first instruction on each line. It looks like this,
./two1.bin: line 1: 0010000000001001: command not found
./two1.bin: line 2: 0010001000001001: command not found
./two1.bin: line 3: 0010010000001001: command not found
Anyone have an idea on what I'm doing wrong? I've tried researching this online can't find the correct solution, thanks in advance.
Related
I would like to create a shell script that automatically open the CMD and type 2 lines of command
This is the herierchy
open CMD
Change directory (cd d:\mydirectory\drivers
command ( file.exe start -c )
I tried some examples in the existing posts but it has different ways like editing regedit/run at start up..
What I need is to create a executable file wherein if I click it, it will automatically open cmd and type those commands.
I am not also familiar nor knowledgeable in creating shell scripts.
Hope someone will help. Thank you in advance.
Why do you need to specifically open CMD?
Just create a file, call it script.sh, as follows:
#!/bin/bash
cd d:\mydirectory\drivers
file.exe start -c
Save the script and to make it executable, run chmod +x script.sh
Now, you can run it by just clicking on it.
Alright, I found a solution already. Thank you very much for your time.
I just put these command (step-2 and 3) in notepad
then save as textfile.cmd
AppleScript does not find a command line tool located in /usr/local/bin/.
I've got the following AppleScript command:
do shell script "/usr/local/bin/bitbar refresh"
It results in the error:
error "env: node: No such file or directory" number 127
I checked the directory and the command line tool is indeed in that location. AppleScript does find other tolls installed there, such as brew.
Any ideas?
Try initially adding a new path (i.e. /usr/local/bin/) to the shells PATH variable before running the bitbar refresh command.
For instance, change your do shell script as follows:
do shell script "PATH=/usr/local/bin:$PATH; bitbar refresh"
I am a bit surprised, but I can't run matlab by the terminal of my Mac.
I am trying the command
/Applications/MATLAB_R2015b.app/bin/matlab
but I get the error
-bash: matlab: command not found
Listing the contenents of the folder /Applications/MATLAB_R2015b.app/bin/ I can see the word matlab which is supposed to be the executable.
I don't know what's happening.
Try
cd /Applications/MATLAB_R2015b.app/bin/
and then
./matlab
If that, hopefully, works, then you may have a path or environment issue with your O/S which is preventing your call to /Applications/MATLAB_R2015b.app/bin/matlab from working.
add the installation directory to the PATH environment, for example:
export PATH=/Applications/MATLAB_R2017b.app/bin/:$PATH
then launch Matlab with
matlab
in your terminal
It works fine, however, if you used the default folder it would be something like export PATH=/usr/local/MATLAB/R2021b/bin/:$PATH
Additionally, remember about activating matlab before via running the activate_matlab.sh script located in the installation folder
I tried following the steps from this blog.
As my machine works on Windows 10, I used the "Execute Windows batch command", instead of the "Execute shell" command. The command which I wrote down was the following:
C:\<a long path here>\matlab.exe" -nodisplay -nosplash -nodesktop -r "run('C:\<a long path here>\mfile.m');
in an attempt to open a MATLAB file. This works when I do it on the command line of my computer. After saving the job in jenkins, with this build, the build is successful but I get the following result:
Theoretically, the result on the console output should be the something similar to the following, as it is shown on the blog which I mentioned previously(bearing in mind that I have done something different in my attempt to open an existing script):
One thing that I suspect is that this happens because the directory in which the file that I am trying to open is saved, is different from the directory in which MATLAB is installed. When I tried saving a MATLAB file in the directory in which MATLAB is installed, my computer would not let me to do it. Any ideas on how I can solve this. Thank you in advance for your time!
Hi can anyone help me out ?
I have just gotten a new laptop for developing and i have come to a halt already(7 mins).
When accessing files via the command prompt i keep getting this error "The directory name is invalid."
My file is saved on the desktop , i can navigate there well and good its just i cant enter into my eggs file or any file on my desktop via the command prompt. The path is correct.
C:\Users\toshiba\Desktop> cd ChromeSetup.exe
The directory name is invalid.
I have messed around with the command prompt settings and that but to no avail :/. If someone could help me out id be so grateful as i have to start an important project and have been stuck on this for a while now. Thanks in advance.
You can CD to folders, not to files.
This is because CD is short for:
Change Directory
cd ..\..\toshiba\Desktop should work, because you CD in your folders
running cd ChromeSetup.exe is never going to work, unless ChromeSetup.exe is some weird folder name.
If you want to execute that executable without closing the CMD prompt, run this command:
cmd /K "ChromeSetup.exe"
If you want to open a file with a chosen program, use the executable command and give the filename as parameter:
"C:\Program Files\Adobe\Photoshop\photoshop" "C:\Users\user\Documents\document.pdf"