The permission bit in a file mode that allows a file to be run as a program. Also, questions related the format of program files, and to locating and executing program files.

learn more… | top users | synonyms

1
vote
1answer
230 views

permission and user/group of a program executed through a script

I am curious, in the following scenario, what kind of permission does a shell script or Java program has (owner/group/other)? There is a script called run.sh, and it in turn calls a Java program ...
1
vote
3answers
4k views

Cannot execute binaries in Ubuntu : file not found

When I try to run any executable file a file not found error occurs. Sometimes it says nothing but doesn't do anything. For example, when I execute ./blah-blah.bin it fails finding the file when it ...
7
votes
5answers
5k views

#!/bin/bash - no such file or directory

I've created a bash script but when I try to execute it, I get #!/bin/bash no such file or directory I need to run the command: bash script.sh for it to work. How can I fix this?
3
votes
1answer
577 views

Set executable heap

The execstack program can be used to mark ELF-binaries as needing an executable stack. Is there a similar way to mark the heap as executable? Preferably for a single binary but if that's not ...
27
votes
5answers
1k views

Execution of possibly harmful program on Linux

I'm writing a program that will test programs written by students. I'm afraid that I can't trust them and I need to make sure that it won't end up badly for the computer running it. I was thinking ...
0
votes
0answers
241 views

python error using an executable with Z shell

I'm getting this error from the Unix Z shell (I'm on Mac): python: posix_spawn: /System/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python: No such file or ...
1
vote
1answer
178 views

How to search folder with only x set (execution) permission

I have read that if folder has only x set permission to execute it actually means that you are permitted to search this directory. So how to search it?
3
votes
1answer
843 views

“Permission denied” when starting binary despite “rwx” priviledge

I am trying to run the statistics software Stata 11 on Ubuntu 11.10. as a regular user and I get the following error message: bash: xstata: Permission denied The user priviledges seem ok to me as a ...
3
votes
3answers
4k views

Where do executables look for shared objects at runtime

The title is pretty explicit. I understand how to define include shared objects at linking/compile time. However I still wonder how do executables look for the shared object (*.so libraries) at ...
8
votes
3answers
434 views

Is there a way to execute a native binary from a pipe?

echo 'main(){}' | gcc -xc - -o /dev/stdout | ??? Is there a way to run the output binary on a unix-like system? EDIT: I needed it to run the output of g++ in a sandboxed environment where I can't ...
2
votes
2answers
732 views

How do I install multiple java command-line programs?

I have a bunch of java command-line programs I've written and would like to install for all users. Building with NetBeans, I get a /dist directory which contains myprog1.jar and a /libs directory ...
3
votes
1answer
852 views

When executable files aren't [duplicate]

Possible Duplicate: Can't execute some binaries in chroot environment (zsh: Not found) Today I ran into something that has me stumped. A co-worker is working with a specific ...
2
votes
1answer
440 views

Problem when installing “ia32-libs”

I'm using x64 Ubuntu. A few months ago I accidentally messed up the groups/owners of all files on /, but managed to fix it using a VirtualBox install of Ubuntu. Now I'm running into a problem that I ...
2
votes
1answer
202 views

Can I use the same binary on Linux, *BSD and Illumos?

I want to know, if I can use the binary of a program without modification on the three systems? After all they are all Unices. I talk about the same architecture.
11
votes
5answers
4k views

How can I use environment variables in my shebang?

I have a Python script that need to be run with a particular python installation. Is there a way to craft a shebang so that it runs with $FOO/bar/MyCustomPython?
5
votes
1answer
136 views

How would one detect if external command exists in a script?

Is there a way to detect if an external command exists (i.e. wget, svn)? More specifically today, i was trying to run one of my scripts i wrote and the person didn't have wget or svn installed. The ...
0
votes
0answers
29 views

Problem with calling program from the command line [closed]

Note: this is a cross post with this post on SO. I am trying to build a command line wrapper in Python 3 for an exiting command line tool called 'spooky' and I am having a hard time understanding ...
8
votes
1answer
971 views

How to run my own program without specifying its path

Let's suppose I have compiled something and I run it like so: $ /path/to/my/executable/mycmd Hello World What do I need to do to run it like $ mycmd Hello World from everywhere in my computer? ...
3
votes
3answers
354 views

How to grep recursive UNIX tree results along with each tree node?

Here is what I do tree -R /Applications/NetBeans/NetBeans\ 7.0.app/ | perl -e 'while (<>) { print if /java$/ }' but of course this doesn't return the result I want. What I want is to display ...
3
votes
4answers
3k views

File permission execute only

How can I set file to be executable only to other users but not readable/writable, the reason for this I'm executing something with my username but I don't want to give out the password. I tried : ...
1
vote
2answers
231 views

Weird executabe behaviour

I have a server machine with ubuntu 9.10. I am trying to put in place an executable, which turns out to be the latest flashplayer (debugger version). Somehow the file appears as present and ...
4
votes
2answers
2k views

Problem with $PATH and executable file

I am a complete unix noob so please forgive my simple question. I have a unix executable file located in a directory I generated. I believe I need to get this directory in my $PATH so that the unix ...
4
votes
3answers
267 views

Why do you need the “./” when executing programs in the current directory? [duplicate]

Possible Duplicate: Why do we use “./” to execute a file? It seems redundant and gets annoying after a while -- is there a way to change this? If not, can somebody explain the ...
5
votes
3answers
3k views

The way to use `/usr/bin/env sed -f ` in shebang?

Typing /usr/bin/env sed -f in terminal works. But if use it as a shebang, #!/usr/bin/env sed -f s/a/b/ The script will be fail to execute: /usr/bin/env: sed -f: No such file or directory I ...
6
votes
1answer
180 views

Bash executes a different file from the one prompted, even when providing full path

I imagine there's a environment variable or some setting I'm unaware of, but this is driving me nuts. baco:~ # ls -la /root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin -rwxr-x--- 1 ...
4
votes
2answers
157 views

Can an executable know where it is stored?

Can an executable know where it is stored? For my open source project, I wrote a small bash script to automate some operations. The script lies at the root of the project and performs its tasks on ...
7
votes
2answers
373 views

Detect if an ELF binary was built with gprof instrumentation?

Is it possible to check if given program was compiled with GNU gprof instrumentation, i.e. with '-pg' flag passed to both compiler and linker, without running it to check if it would generate a ...
2
votes
1answer
513 views

Cannot open shared object file when using D compiler

I had ldc2 and gdc compiled from source and working up until a month ago. Nothing has changed, except I can't remember the variable(s) I would set in the terminal to get ldc2 and gdc to work. I get ...
12
votes
1answer
699 views

Why does the file command say that ELF binaries are for Linux 2.6.9?

Whenever I run file on an ELF binary I get this output: [jonescb@localhost ~]$ file a.out a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked ...
24
votes
2answers
10k views

Getting “Not found” message when running a 32-bit binary on a 64-bit system

I have currently a strange problem on debian (wheezy/amd64). I have created a chroot to install a server (i can't give any more detail about it, sorry). Let's call its path /chr_path/. To make things ...
3
votes
2answers
2k views

Running C Programs on Linux

I watched a video lecture today that introduced C and things like how to make a C program that will run in Linux. I followed the steps given and now I'm stuck with a bit of a problem. I created my C ...
8
votes
2answers
3k views

Creating Static Binary

I installed an application [ e.g. fdisk ]. But it required libraries for execution. I am looking for utility/tool which will help me to create a static binary from already installed binaries. So that ...
0
votes
1answer
4k views

Modelsim for ubuntu

I am looking to download modelsim for ubuntu. But the site gives only .exe file. Can I still install the software? Does modelsim exist for ubuntu? If yes, where can I find it? Thank you.
1
vote
1answer
326 views

How to block the execution of files owned by root through lighttpd?

I've created a group and a user to run lighttpd. I would like to run from the web server only files that have these permissions (myuser:mygroup). I don't want to run files with root permissions. Is ...
1
vote
1answer
348 views

No exec permissions on programs in /usr/local/bin

I have installed the newest Erlang from source. As the final step I have executed sudo make install Among other things, it placed erl link in /usr/local/bin, but its permissions are insufficient ...
1
vote
1answer
2k views

“No such file or directory” lies on Optware installed binaries

I've been using Optware to install packages on my ARM-based NAS for a while - the usual stuff like Transmission, Samba and others. However, I'd been having problems with Transmission hanging not long ...
10
votes
2answers
4k views

Binary compatibility between Mac OS X and Linux

Brace yourselves, this question will likely appear naive and/or foolish, seeing as I am relatively new to the inner workings of unix like systems, and programming in general. Ready? Ok! I will go ...
6
votes
1answer
435 views

Why do some symbolic links affect program behavior?

One thing that has been puzzling me for some time is this: % which halt /sbin/halt % file /sbin/halt /sbin/halt: symbolic link to `reboot' However, executing sudo halt does, of course, not reboot ...
3
votes
1answer
604 views

More doubts in bzImage

The description of the bzImage in Wikipedia is really confusing me. The above picture is from Wikipedia, but the line next to it is: The bzImage file is in a specific format: It contains ...
64
votes
2answers
13k views

How do I clear Bash's cache of paths to executables?

When I execute a program without specifying the full path to the executable, and Bash must search the directories in $PATH to find the binary, it seems that Bash remembers the path in some sort of ...
5
votes
2answers
1k views

Find command: Searching for executable files

What type of parameter/flag can I use with the unix find command so that I search executables? (if this question is better suited for another stackexchange forum, I welcome you telling me so) p.s. ...
23
votes
4answers
12k views

Why do we use “./” to execute a file?

Why do we use ./filename to execute a file in linux? Why not just enter it like other commands gcc, ls etc...
24
votes
7answers
24k views

What is /usr/local/bin? Came across it in an script installation for Applescript but would like to know more

Before today, I've used Terminal to a limited extent of moving in and out of directories, changing the dates of files using the touch command, but had realised the full extent of Terminal after ...
5
votes
2answers
18k views

./executable: cannot execute binary file

I have a script that works well when I ssh to the server to execute it myself, but has problems when Hudson, a continuous integration server, runs it. I am automating tests on an embedded linux ...
20
votes
4answers
6k views

What makes OSX programs not runnable on Linux?

I know there are many differences between OSX and Linux, but what makes them so totally different, that makes them fundamentally incompatible?
20
votes
8answers
15k views

Different ways to execute a shell script

There a several ways to execute a script, the ones I know are: /path/to/script # using the path (absolute or relative) . script # using the . (dot) source script # using the `source` command ...
14
votes
1answer
8k views

What are stripped and not-stripped executables in Unix?

From man file, EXAMPLES $ file file.c file /dev/{wd0a,hda} file.c: C program text file: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses ...
10
votes
5answers
7k views

Can we get compiler information from an elf binary?

Is there some chance to know how a binary was built, under Linux? (and or other Unix) Compiler, version, time, flags etc... I looked at readelf and couldn't find much, but there might be other ways ...