Solved

Run C from Terminal

Posted on 2011-09-14
3
311 Views
Last Modified: 2016-02-10
Hey people,

I'm not a programmer or coder, someone just gave me a binary and C source file. I'm just trying to run it from terminal and I'm getting "command not found.

I copied the binary and C source file to my root (file names are "sector_size.c" and "sector_size", and this is what I do from Terminal

thanasimacpro:/ thanasikala$ cd /
thanasimacpro:/ thanasikala$ sudo ./sector_size /dev/disk0
Password:
sudo: ./sector_size: command not found
thanasimacpro:/ thanasikala$ 

Open in new window


Ideas?

Thanks
0
Comment
Question by:chipped
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 36535824

You should issue "sudo chmod +x ./sector_size" beforehand!

wmp
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 36535849
Is "sector_size" indeed present in / ?
Is it really a binary, or is it a script with a wrong shebang line (#!/...) at the top?
0
 

Author Closing Comment

by:chipped
ID: 36535926
God damn, I knew it would be something this easy.

Thanks.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question