Sponsored Content
Top Forums Shell Programming and Scripting Automatically execute all programs in a directory Post 302428393 by Corona688 on Wednesday 9th of June 2010 04:59:17 PM
Old 06-09-2010
Probably, but you never gave any information whatsoever on that; do you have a list, or are we supposed to trawl the current directory for executable files, or executables but not scripts(if there's a ./configure in there you probably don't want your test system to run it! Smilie ) or should we look for files with a certain extension, or are you expecting us to query the makefile itself somehow, etc, etc, etc. Your pseudocode was the first hint we had. Smilie

To just run a list of commands from a textfile:

Code:
while read COMMAND
do
        $COMMAND
        echo -n "Hit enter"
        read
done < textfile

Or to find all executable files:

Code:
find ./ -maxdepth 1 -execuable -not -name 'configure' |
while read COMMAND
        $COMMAND
        echo -n "Hit enter"
        read
done

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Removing files automatically from a directory after 30 days.

Hello; I have a directory that is collecting log and act files. I need to write a script that will remove these files once they are 30 days old. I have read through a number of threads on this site that have given me a great deal of information. However I have what seems to be a unique... (7 Replies)
Discussion started by: justinb_155
7 Replies

2. Shell Programming and Scripting

help to execute programs in sequence through batch

I need help to create batch file . I want to run some programs in sequence in batch mode . I have one file which contains the name of program and command The test.bat file contain this data stsrun -v devel area1.exp stsrun -v devel prime1.exp stsrun -v devel treat.exp Please help... (1 Reply)
Discussion started by: getdpg
1 Replies

3. UNIX for Advanced & Expert Users

i want a script to execute if the time is 12:00 automatically

i write a script for displaying a xmessage.But i want it to run automatically for every one hour.can any one help me. (2 Replies)
Discussion started by: lakshmananindia
2 Replies

4. AIX

Execute "telinit q" while programs are running ?

Hi, I want to make changes to inittab file and reread it using "telinit q" to make changes effective immediately. Is it safe to do that while important apps are running ? thanks Vilius (1 Reply)
Discussion started by: vilius
1 Replies

5. UNIX for Dummies Questions & Answers

Initialization Problems - Cannot execute automatically

Figured out the first half but am still having a little trouble shooting problem with the Initialization Files. I am working in bash on a remote server. When I log on I am seeing the correct prompt but right before that I am also seeing this the id -u integer expression expected is what... (2 Replies)
Discussion started by: moonunit
2 Replies

6. Fedora

Automatically execute a software without gui at boot

hi all, this is my first post here...i hope that this is the correct section to write my question. I have a distro linux without gui, only text mode. So, it's possible run automatically a command or a program as "top" or "ping" and get the result on the main shell , after the boot and after... (6 Replies)
Discussion started by: gangiaemi
6 Replies

7. UNIX for Advanced & Expert Users

How to i execute .rdf file oracle report automatically in cron tab unix

Hi, I want to execute .rdf file which uses oracle report in crontab ..Can you please help me out how to schedule it crontab.as it is a rdf file Please give any suggestions regarding the above issue. (0 Replies)
Discussion started by: soumyamishra
0 Replies

8. Shell Programming and Scripting

Automatically determining directory path for scripts and programs

I have some C++ code in the following directory structure /home/chrisd/tatsh/trunk/hstmy/ ├── baseLib ├── bin │ ├── awk │ ├── bash │ ├── diag │ ├── ksh │ │ └── TAG201011 │ ├── old │ ├── perl │ ├── prog │ ├── py │ └── tcsh ├── docs ├── fortran ├── others... (0 Replies)
Discussion started by: kristinu
0 Replies

9. Homework & Coursework Questions

Need help on how to execute several programs

1. The problem statement, all variables and given/known data: Get each of these programs to run. Prove that you've done this(use script). Give a description of each program along with sample executions. These are the exact programs we were given. 2. Relevant commands, code, scripts,... (11 Replies)
Discussion started by: FaTaL
11 Replies
USELIB(2)						     Linux Programmer's Manual							 USELIB(2)

NAME
uselib - select shared library SYNOPSIS
#include <unistd.h> int uselib(const char *library); DESCRIPTION
uselib selects the shared library binary that will be used by the calling process. RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately. ERRORS
In addition to all of the error codes returned by open(2) and mmap(2), the following may also be returned: ENOEXEC The file specified by library is not executable, or does not have the correct magic numbers. EACCES The library specified by library is not readable. CONFORMING TO
uselib() is Linux specific, and should not be used in programs intended to be portable. SEE ALSO
ar(1), gcc(1), ld(1), ldd(1), mmap(2), open(2), ld.so(8) Linux 0.99.11 1993-07-24 USELIB(2)
All times are GMT -4. The time now is 06:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy