Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scam not recognized (Mac)
#1
When trying to use scam as a command to run a file, I receive the bash error "scam: command not found" on the terminal application for Mac. I thought (and still do) that it might be the fact that in the install I used the command 'cp scam ~/bin' instead of 'sudo cp scam /usr/bin'. Is that the case? If so, when I try to run 'sudo cp scam /usr/bin' I enter my password, and I am then greeted with the error "cp: /usr/bin/scam: Operation not permitted". Any help?
Reply
#2
In your scam directory, run these commands:

file scam

ls -l scam

what do they report?
Reply
#3
(08-28-2017, 06:37 PM)lusth Wrote: In your scam directory, run these commands:

file scam

ls -l scam

what do they report?

Joshs-MacBook-ProConfusedcam joshcollins$ file scam
scam: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=b56776b47a5c316bf0a4ba2a2a3c0e411324a22e, not stripped
Joshs-MacBook-ProConfusedcam joshcollins$ ls -l scam
-rwxr-xr-x  1 joshcollins  staff  609608 Aug 16 11:29 scam
Joshs-MacBook-ProConfusedcam joshcollins$ 
Reply
#4
Looks like you downloaded the Linux version, not the Mac version. Do this:

Code:
sudo rm /usr/bin/scam
cd ~/scam
rm *.tgz
wget beastie.cs.ua.edu/scam/scam-2.4-OSX_64.tgz
tar xvfz scam-2.4-OSX_64.tgz
sudo cp scam /usr/bin/
Reply
#5
(08-28-2017, 07:00 PM)lusth Wrote: Looks like you downloaded the Linux version, not the Mac version. Do this:

Code:
sudo rm /usr/bin/scam
cd ~/scam
rm *.tgz
wget beastie.cs.ua.edu/scam/scam-2.4-OSX_64.tgz
tar xvfz scam-2.4-OSX_64.tgz
sudo cp scam /usr/bin/

Still getting an "Operation not permitted" error.

Joshs-MacBook-Pro:~ joshcollins$ sudo rm /usr/bin/scam
Password:
Sorry, try again.
Password:
rm: /usr/bin/scam: No such file or directory
Joshs-MacBook-Pro:~ joshcollins$ wget beastie.cs.ua.edu/scam/scam-2.4-OSX_64.tgz
--2017-08-28 20:44:29--  http://beastie.cs.ua.edu/scam/scam-2.4-OSX_64.tgz
Resolving beastie.cs.ua.edu... 130.160.143.106
Connecting to beastie.cs.ua.edu|130.160.143.106|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 260739 (255K) [application/x-gzip]
Saving to: ‘scam-2.4-OSX_64.tgz’

scam-2.4-OSX_64.tgz       100%[==================================>] 254.63K  --.-KB/s    in 0.06s   

2017-08-28 20:44:29 (4.30 MB/s) - ‘scam-2.4-OSX_64.tgz’ saved [260739/260739]

Joshs-MacBook-Pro:~ joshcollins$ tar xvfz scam-2.4-OSX_64.tgz
x scam
x compile.lib
x draw.lib
x go.lib
x inherit.lib
x main.lib
x pretty.lib
x random.lib
x reflection.lib
x repl.lib
x sway-repl.lib
x sway.lib
x sway.main.lib
x thread.lib
x draw.scm
x drawCS.scm
x drawEE.scm
Joshs-MacBook-Pro:~ joshcollins$ sudo cp scam /usr/bin
cp: /usr/bin/scam: Operation not permitted
Joshs-MacBook-Pro:~ joshcollins$ 

When inputting our previous debugging code I get the following:

Joshs-MacBook-Pro:~ joshcollins$ file scam

scam: Mach-O 64-bit executable x86_64

Joshs-MacBook-Pro:~ joshcollins$ ls -l scam

-rwxr-xr-x  1 joshcollins  staff  606240 Aug 16 11:27 scam
Joshs-MacBook-Pro:~ joshcollins$ 

Seems I have the right file now, but no success in being able to run the command.

Reply
#6
Temporarily, you can run scam with the command:

~/scam/scam hello.scm

Install the submit script (see the links at the bottom of assignment 1) and then you can copy the scam executable to your own bin.
Reply
#7
Something is messed up on your Mac in that sudo is not working (or /usr/bin/ is messed up). You can sign up for office hours and I can take a look.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)