Command line not recongnising commands - command

I am super new to command line and am following this yt video - https://www.youtube.com/watch?v=MBBWVgE0ewk&list=PL6gx4Cwl9DGDV6SnbINlVUd0o2xT4JbMu
I am having trouble cd and .. to directories as the above tutorial does. I get thrown an error saying that the directory does not exist or the ..is not a recognized command.
This is really putting me off cl as its only the first step towards using cl.
My command line

Related

How to run perl script on Ubuntu

How to run perl script on Ubuntu?
How to run this script
https://zwitterion.org/software/aggregate-cidr-addresses/
I’ve created the file aggregate-cidr-addresses as shown in the example.
I’ve copied the file from the server in the same directory
then I run as shown in the example
root#Ubuntu:~$ list-iana-reserved-ranges | aggregate-cidr-addresses
list-iana-reserved-ranges: ukaz ni bil najden (translate command not found)
aggregate-cidr-addresses: ukaz ni bil najden (translate command not found)
and also
root#Ubuntu:~$ perl list-iana-reserved-ranges | aggregate-cidr-addresses
Number found where operator expected at list-iana-reserved-ranges line 2, near "192.168.1.0"
(Missing semicolon on previous line?)
syntax error at list-iana-reserved-ranges line 2, near "192.168.1.0"
Execution of list-iana-reserved-ranges aborted due to compilation errors.
aggregate-cidr-addresses: ukaz ni bil najden (translate command not found)
I've got
command not found
How to run this properly?
To run a Perl script,
put the interpreter in the first line of the files with a "shabang" or "hash bang" (#!), which the script you linked to already has:
#!/usr/bin/perl
make the files executable:
chmod +x list-iana-reserved-ranges aggregate-cidr-addresses
add ./ to the beginning of the filenames (this is a Linux security feature to not accidentally run scripts in your current directory):
./list-iana-reserved-ranges | ./aggregate-cidr-addresses

Pintos installation SIGVTALRM() redefined error

I got no error during installation, all make commands worked perfectly but in the end when I run "pintos run alarm-multiple", I'm getting the following error
Prototype mismatch: sub main::SIGVTALRM () vs none at /home/suhas/bin/pintos line 949.
Constant subroutine SIGVTALRM redefined at /home/suhas/bin/pintos line 941.
Writing command line to /tmp/k5qCPWWL5b.dsk...
squish-pty bochs -q
exec: No such file or directory
Any help would be highly appreciated. Thanks.
This is a simple task. Just go to the file /home/suhas/bin/pintos and comment out the whole function SIGVTALRM(). It should work fine. Even I had the same error.

Compilation failed in require when using "use" in Perl

I am using Perl in Eclipse.
In the same directory, I have a .pl file and two .pm files (pmFile1.pm, pmFile2.pm).
At the top of the .pl file, I use the command:
use pmFile1;
use pmFile2;
I get an error
Compilation failed in require
I do not believe I had this error earlier. I have researched this error online, and cannot figure out what may have caused it, because I have not found a similar situation to mine that caused the error. I do not know what other information would be pertinent to include, but will add anything if asked...
Thank you.
I suggest you check the module pmFile1.pm for errors in a terminal shell
$ perl -c pmFile1.pm
syntax error at pmFile1.pm line 1, near "."
pmFile1.pm had compilation errors.
When entering a single dot . as a syntax error into pmFile1.pm and running the p.pl file then the errors below are shown in Eclipse, the same as you described. If you run the .pl file in a terminal shell then you get the same compilation failed in require as in eclipse:
$ perl p.pl
syntax error at pmFile1.pm line 1, near "."
Compilation failed in require at p.pl line 1.
BEGIN failed--compilation aborted at p.pl line 1.
This may not be your problem, but I've been "bitten" by something similar before: check the End of Line chars in the file. It may be that your code is seen by the compiler to be all one line, making an error anywhere in the code appear as being on line 1 when visually (in the editor) the offending line would be later in the code. In notepad++ you resolve this sort of issue by using the Edit > EOL Conversion > Windows Format (or whatever format is correct for you) menu option, though other editors will likely have a similar feature for *NIX <-> Windows EOL conversions. This error would make sense if you can successfully use the module files giving you an error without errors in other script files.
I solved this by changing the required package to some dummy name, then retaining it.

Running Executable from Shell Script

I am having trouble launching an executable that I have created from a shell script. I would like to automate testing by running the program many times with different command line options to verify it is working.
When I type echo $SHELL, /bin/sh is displayed.
The following is my shell script:
#!/bin/sh
clear
echo "Running first test."
./myProgram
exit 0
When I run the script (sh myScript.sh), with myProgram in the same directory, I see the following output:
Running first test.
: not foundsh: line 4:
When executing the program ./myProgram, it runs as expected with no command line options.
I have also tried:
myProgram
./myProgram &
myProgram &
based on answers to somewhat similar questions, but they all result in the above error message.
Your newlines are goofed. Use dos2unix to fix.
why don't you try using the full path?
e.g., if myProgram is in /home/user1/bin, you can try /home/user1/bin/myProgram instead of ./myProgram. This should work.
You can also add the path to path variable, $PATH and directly call myProgram from anywhere.
Run "export PATH=$PATH:/home/user1/bin" on your terminal without the quotes. Note that this affects only your current termial session. If you want to permanently add the path, update your .bashrc file in your home directory with the following line:

Custom run script error in Xcode

I'm trying to write a custom script as a separate build step in Xcode. To do that I've created Run script build phase. However I receive an error on this simple line (that's all I have in my script):
INCLUDE_PATH = $CONFIGURATION_BUILD_DIR/include
Error is
...Script-50117A74154B5E6100C6297E.sh: line 6: INCLUDE_PATH: command
not found Command /bin/sh failed with exit code 127
Found that! There should not be any spaces in a variable declaration.
INCLUDE_PATH=$CONFIGURATION_BUILD_DIR/include