Error: bash: ./: Is a directory CS50 IDE - cs50

I'm having a serious problem with CS50 IDE. Everything I did yesterday doesn't seem to be working today. I am compiling files fine, but now can't get them to run because I'm getting the error "bash: ./: Is a directory".
Here is a screenshot of the error:
And here is my folder structure

There should not be a space between ./ and the name of the file, i.e. use ./hello and not ./ hello. Note the space in the second command I have used.

Related

How to fix this error while trying to build a ns3 simulation?

I have a simulation called adhoc-simulation.cc in a folder called scratch so it should be running fine, however when I build it using this command sudo ./waf --run adhoc-simulation in the ns-3.33 folder I get this error:
FileNotFoundError: [Errno 2] No such file or directory: '/home/*/ns-3-allinone/ns-3.33/build/ns3/yans-wifi-helper.h'
I got the same error using latest version of ns3,I used ./ns3 run filename command,it worked for me.

Android Asset Package Manager (appt) is not found

I am in correct directory (OSX Sierra)
/Users/username/Library/Android/sdk/build-tools/27.0.3
I use ls and see aapt, but when I run the aaptexecutable, this error results
-bash: aapt: command not found
Why is appt not found though I am executing from correct directory?
Thanks
Apparently the terminal doesn't have direct access to the executables in the current working directory. The absolute path appears to work:
/Users/username/Library/Android/sdk/build-tools/27.0.3/aapt

Error "syntax error near unexpected token '&' - trying to run a file from command line within an application

I am a newbie to Linux and I am only really using it to use a program for my final year thesis. I have got to grips with the language for the program but am having issues with actually running it in Linux. The program is called "CACTUS" and all documentation can be found here.
I have extracted the application file and I have made the executable as instructed in the install.txt file:
"Installation of CACTUS for Linux or Mac machines.
Unzip the directory and put in desired location. On terminal cd into the
correct directory (you should be able to see the makefiles).
Create the executable by typing:
$make
or
$make -f Makefile.gfortran
on the terminal. The executable will be called cactus and be located in the
directory one level above.You can add the executable's location to your path
so that you can call it by simple typing cactus on the terminal instead of
the complete path.
cd into the Test/RegTest directory
$cd ./Test/RegTest
and run the RegTest by executing runreg.py with the path to the CACTUS
executable as an argument (or just the name of the executable if you added it
to your path).
$./runreg.py ../../../cactus
or
$./runreg.py cactus
The output should say 'No differences' for all three tests. Note: if you have
Python 3 installed used runreg_p3.py instead.
CONGRATULATIONS! You have successfully installed CACTUS.
I have run this and I didn't get the "No Differences" returned on the runreg.py. I continued anyway as I did not know why or how I could fix this. (This may be a root cause of my overally problem here)
As I progressed I have been trying to open an input file "TestVAWT.in" from TestCase2 with the following command:
./TestVAWT.in ../../../cactus
From this I get the error in the title returned. Am I correct in assuming that it has tried to run the TestVAWT.in file on the command line without referring to the Cactus application which I presume would be able to read the '&' prefix of the code along with the rest of the input file. Or is it something else I am missing here.
I would appreciate any help as I have been banging my head against a wall for some time now.
Note: I am using Ubuntu 14.04 LTS.
Best Regards
Richard
Don't know the application, but looks kind of strange to me.
Please try adding the Input-File as a parameter:
cactus TestVAWT.in

Issue with running Bash script in linux.

Im having an issue with a bash script i picked up from google code. I have all the dependencies installed and i have it setup to what i think is correct.
To run the code im typing into the console ./jasagerPwn.sh
The error its saying is
[!] FATAL: You must run jasagerPwn from inside the directory...
....WHAT DIRECTORY? I dont know what directory it expects me to run it from?
You can see the script i am using here: http://jasagerpwn.googlecode.com/svn/trunk/jasagerPwn
When you run the script, it looks in the current dir if you have something matching jasagerPwn. If not, the error you was encountering appears.

sh: 0: getcwd() failed: No such file or directory on cited drive

I am trying to compile ARM code on Ubuntu 12.04 (Precise Pangolin).
Everything is working fine when I put the code in the local directory.
But when I put the code in the cited mount directory, an error shows up:
making testXmlFiles
sh: 0: getcwd() failed: No such file or directory
ARM Compiling xxxxx.c
sh: 0: getcwd() failed: No such file or directory
Here is my setting in fstab:
//10.0.0.1/data /mnt/data cifs auto,noserverino,credentials=/root/.smbcredentials,file_mode=0777,dir_mode=0777,uid=user,gid=users,noperm 0 0
What is going on here? What could cause this error?
This error is usually caused by running a command from a directory that no longer exists.
Try changing your directory and rerun the command.
That also happened to me on a recreated directory. The directory is the same, but to make it work again, just run:
cd .
Try the following command. It worked for me.
cd; cd -
This can happen with symbolic links sometimes. If you experience this issue and you know you are in an existing directory, but your symbolic link may have changed, you can use this command:
cd $(pwd)
In Ubuntu 16.04.3 LTS (Xenial Xerus), the following command works for me:
exit
Then I've login again.
Please check whether the directory path exists or not. This error comes up if the folder doesn't exist from where you are running the command.
Probably you have executed a remove command from the same path on the command line.
If some directory/folder does not exist, but somehow you navigated to that directory, in that case you can see this error.
For example:
currently, you are in the "mno" directory (path = abc/def/ghi/jkl/mno
run "sudo su" and delete mno
go to the "ghi" directory and delete the "jkl" directory
now you are in the "ghi" directory (path abc/def/ghi)
run "exit"
after running the "exit", you will get that error
now you will be in "mno"(path = abc/def/ghi/jkl/mno) folder. That does not exist.
So, generally this error will show when the directory doesn't exist.
To fix this, simply run "cd;" or you can move to any other directory which exists.
In my case, none of the previous answers has worked.
After banging my head against the wall for a while I've found out, that I've destroyed the /etc/passwd entries by running a custom-made-linux-server-setup-bash-script which worked well previously, but this time the regex within the "sed" command erased all the existing entries :D
After copy pasting the default entries from another working Linux server, I could finally restart sshd.
So don't forget to back up the original /etc/passwd file before applying any regular expression replacements on it :)

Resources