Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Help with sorting executable files in shell Post 302586119 by methyl on Friday 30th of December 2011 07:43:04 AM
Old 12-30-2011
First let's get the "find" right: We're looking for any executable file so we need to check User, Group and Other permissions for the Executable bit. Within the protected brackets of this command the two standalone "-o" switches mean "OR".

Code:
find "${dir_name}" -type f \( -perm -u+x -o -perm -g+x -o -perm -o+x \)

Now ... the output from "find" will be a straight list of filenames which does not mention the size of the file.
This User Gave Thanks to methyl For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Executable files

This question always confuses me :- Suppose I write a program and compile it on a machine with operating system A and processor B will the exe file run on a machine with operating system A2 but processor B operating system A but processor B2 operating system A2 and processor B2........ ... (9 Replies)
Discussion started by: nervous
9 Replies

2. Shell Programming and Scripting

Need to call an Executable (.exe) using shell

Hi all , I need to call an executable (.exe) using shell script. Actual need is i need to call that shell script and do an export of some tables is there any way . the executable is datamover Please let me know if there are any option !! (2 Replies)
Discussion started by: raghav1982
2 Replies

3. UNIX for Dummies Questions & Answers

executable files

hello. My question, basically is: what is the definition of unix/linux exec files, or what makes a file executable? More specifically, must a unix source file that was compiled using gcc have exec permissions in order to be considered executable? Is it right to say that a unix/linux exec file... (1 Reply)
Discussion started by: nadavkri
1 Replies

4. Shell Programming and Scripting

Exit shell after setting executable to run?

Hi, I have an executable file that has a rather long and tedious process to complete. How would I launch the executable using the shell, and then exit the shell while leaving the executable to run in the background? (1 Reply)
Discussion started by: pcwiz
1 Replies

5. Shell Programming and Scripting

convert shell script into a binary executable

Hello every one, i want to convert my shell script into a binary executable a .exe file , is it possible to do that if so are there any tools . Would the script take off when the arguments are parsed. Thanks Venu (13 Replies)
Discussion started by: venu
13 Replies

6. Homework & Coursework Questions

File Looping - Looking for executable files - Need help

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! Hello all, I have posted here before and really was blown away by the amount of assistance I received. I was able to finish my homework without a problem! But, yet again, our... (6 Replies)
Discussion started by: Bob07
6 Replies

7. Shell Programming and Scripting

[SHELL] Executable? Run it!

I would like to make a script that I can see if the file is executable. If it is executable then it needs to run. Otherwise, if it is not executable the file needs to be edited, and run agian. I hope you understand what i mean. :) Thanks for the netherlands (4 Replies)
Discussion started by: dennisbest85
4 Replies

8. UNIX Desktop Questions & Answers

creating an executable file from shell scripts

Hi Friends, I have a shell script which does some operations etc, would it be possible to create an executable file out from this shell script? meaning the executable file is not editable, thus the source code will not be visible to other users for copyright reasons. Please help, thanks! (1 Reply)
Discussion started by: kokoro
1 Replies

9. Shell Programming and Scripting

cygwin executable shell scripts

Hello, Cygwin will execute a shell script without turning on executable status on the file. I want to force cygwin to be more like linux and not execute scripts directly on the command line unless changing mode to have executable status. Is this possible? Thanks Larry (2 Replies)
Discussion started by: larrye0123
2 Replies
OPEN(5) 							File Formats Manual							   OPEN(5)

NAME
open, create - prepare a fid for I/O on an existing or new file SYNOPSIS
Topen tag[2] fid[2] mode[1] Ropen tag[2] fid[2] qid[8] Tcreate tag[2] fid[2] name[28] perm[4] mode[1] Rcreate tag[2] fid[2] qid[8] DESCRIPTION
The open request asks the file server to check permissions and prepare a fid for I/O with subsequent read and write messages. The mode field determines the type of I/O: 0, 1, 2, and 3 mean read access, write access, read and write access, and execute access, to be checked against the permissions for the file. In addition, if mode has the OTRUNC (0x10) bit set, the file is to be truncated, which requires write permission (if the file is append-only, and permission is granted, the open succeeds but the file will not be truncated); if the mode has the ORCLOSE (0x40) bit set, the file is to be removed when the fid is clunked, which requires permission to remove the file from its directory. If other bits are set in mode they will be ignored. It is illegal to write a directory, truncate it, or attempt to remove it on close. If the file is marked for exclusive use (see stat(5)), only one client can have the file open at any time. That is, after such a file has been opened, no other open will succeed until fid has been clunked. All these permissions are checked at the time of the open request; subsequent changes to the permissions of files do not affect the ability to read, write, or remove an open file. The create request asks the file server to create a new file with the name supplied, in the directory (dir) represented by fid, and requires write permission in the directory. The owner of the file is the implied user id of the request, the group of the file is the same as dir, and the permissions are the value of (perm&(~0777|0111)) | (dir.perm&perm&0666) if a regular file is being created and (perm&~0777) | (dir.perm&perm&0777) if a directory is being created. This means, for example, that if the create allows read permission to others, but the containing direc- tory does not, then the created file will not allow others to read the file. Finally, the newly created file is opened according to mode, and fid will represent the newly opened file. Mode is not checked against the permissions in perm. The qid for the new file is returned with the create reply message. Directories are created by setting the CHDIR bit (0x80000000) in the perm. The names . and .. are special; it is illegal to create files with these names. It is an error for either of these messages if the fid is already the product of a successful open or create message. An attempt to create a file in a directory where the given name already exists will be rejected; in this case, the create system call (see open(2)) uses open with truncation. The algorithm used by create is: first walk to the directory to contain the file. If that fails, return an error. Next walk to the specified file. If the walk succeeds, send a request to open and truncate the file and return the result, successful or not. If the walk fails, send a create message. If that fails, it may be because the file was created by another process after the previous walk failed, so (once) try the walk and open again. For the behavior of create on a union directory, see bind(2). ENTRY POINTS
Open and create both generate open messages; only create generates a create message. OPEN(5)
All times are GMT -4. The time now is 11:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy