Sponsored Content
Top Forums Shell Programming and Scripting Executing all scripts in /DIR except one Post 302382790 by proactiveaditya on Friday 25th of December 2009 01:17:55 PM
Old 12-25-2009
Executing all scripts in /DIR except one

First i need to find all scripts directly under /DIR that end with ".sh" extension except "noallow.sh". That can be done with:

Code:
find /DIR -maxdepth 1 -name "*.sh"|grep -v "noallow.sh"

Now i want to run all the files output from the previous command.

The following code:

Code:
for filename in $(find /DIR -maxdepth 1 -name "*.sh"|grep -v "noallow.sh")
do
/DIR/${filename}
done

Can do the job. But i want to know can this whole thing be done by using find only with exec {}.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

executing perl scripts

Does anybody experiencing this same problem? I am using IRIX64 ver 6.5 at work. I wrote some Perl scripts and to execute it. First I try to put the Perl script at: /$HOME/bin/perlscript then I set the correct executable 755 right to the file I make sure the PATH to the executable... (2 Replies)
Discussion started by: vtran4270
2 Replies

2. Shell Programming and Scripting

executing variables in ksh scripts?

In a ksh script on an AIX box running a jillion oracle database processes, I'm setting a variable to one of two possible arguments, depending on cmd line arguments. FINDIT="ps -ef | grep oracle | grep DBexport | grep rshrc" -or- FINDIT="ps -ef | grep oracle | grep prod | grep runback" I... (3 Replies)
Discussion started by: zedmelon
3 Replies

3. UNIX for Dummies Questions & Answers

Executing Shell Scripts

Hi, I'm pretty new to Unix and I just have a question concerning making a script executable without putting the "sh" command before it. In case it makes the difference I am on an Apple computer using the Terminal. Anyway here is the little test code I wrote followed by the commands I took to try... (1 Reply)
Discussion started by: BuyoCat
1 Replies

4. Shell Programming and Scripting

Executing scripts in Parallel

Hi All, I have 3 shell scripts, Script1,Script2 and Script3. Now I want to run Script1 and Script2 in parallel and Script3 should depend on successful completion of both Script1 and Script2. Could you please suggest an approach of acheiving this... Thanks in advance (2 Replies)
Discussion started by: itsme_maverick
2 Replies

5. UNIX for Dummies Questions & Answers

Executing scripts in back ground

Hi, Test1.ksh #! /bin/ksh for i in $* do #echo "$i" ksh test2.ksh $i & done test2.ksh #! /bin/ksh sleep 5s echo "From Test 1 ==> $1" exit 0; I am executing as follows: ksh test1.ksh a b c (10 Replies)
Discussion started by: risshanth
10 Replies

6. Shell Programming and Scripting

executing shell scripts in a browser

Hi all Im a newbie in shell scripting, i found it joyous creating simple adminitrative scripts, like adding users, modify and delete, remote sw install etc, now i want to intergrate my scripts to make a simple administrative tool, how do i access the scripts via a browser is it possible?? ... (2 Replies)
Discussion started by: jefinah
2 Replies

7. Shell Programming and Scripting

Executing several bash scripts in succession

Hi, I am new to shell programming. I am trying to automate setting up a network using several scripts. Some of the scripts require to reboot in order to continue with the setup. Is it possible to enter another script as soon as the system reboots. Also, if the last line of the script is bash... (7 Replies)
Discussion started by: fantasyland
7 Replies

8. Shell Programming and Scripting

how to get the scripts full dir path

lyang0@lyang0-OptiPlex-755:~$ ./test.sh . lyang0@lyang0-OptiPlex-755:~$ cat test.sh #!/bin/bash echo `dirname $0` lyang0@lyang0-OptiPlex-755:~$ pwd /home/lyang0 it doesn't get "/home/lyang0" and only when run /home/lyang0/test.sh it will get, but how can I do, then it can get the real... (8 Replies)
Discussion started by: yanglei_fage
8 Replies

9. Shell Programming and Scripting

Print filename/dir name while executing aclput using find command

Running below command , but unable to print the filename , is there way to print filename/dirname using -print option find . -type f -exec aclput -i fileacl.template {} \; (5 Replies)
Discussion started by: lalitpct
5 Replies

10. Shell Programming and Scripting

Executing multiple scripts using if condition

I have an if condition. If that condition is true then one script will be run and after that I need to check another condition based on the output value of first script. i tried like below : cd lock if ; then rm exitup if ; then kb_shutdown kb_startup if ; then rm exitup if ;... (3 Replies)
Discussion started by: charanarjun
3 Replies
AUTOM4TE(1)							   User Commands						       AUTOM4TE(1)

NAME
autom4te - Generate files and scripts thanks to M4 SYNOPSIS
autom4te [OPTION] ... [FILES] DESCRIPTION
Run GNU M4 on the FILES, avoiding useless runs. Output the traces if tracing, the frozen file if freezing, otherwise the expansion of the FILES. If some of the FILES are named `FILE.m4f' they are considered to be M4 frozen files of all the previous files (which are therefore not loaded). If `FILE.m4f' is not found, then `FILE.m4' will be used, together with all the previous files. Some files may be optional, i.e., will only be processed if found in the include path, but then must end in `.m4?'; the question mark is not part of the actual file name. Operation modes: -h, --help print this help, then exit -V, --version print version number, then exit -v, --verbose verbosely report processing -d, --debug don't remove temporary files -o, --output=FILE save output in FILE (defaults to `-', stdout) -f, --force don't rely on cached values -W, --warnings=CATEGORY report the warnings falling in CATEGORY -l, --language=LANG specify the set of M4 macros to use -C, --cache=DIRECTORY preserve results for future runs in DIRECTORY --no-cache disable the cache -m, --mode=OCTAL change the non trace output file mode (0666) -M, --melt don't use M4 frozen files Languages include: `Autoconf' create Autoconf configure scripts `Autotest' create Autotest test suites `M4sh' create M4sh shell scripts `M4sugar' create M4sugar output Warning categories include: `cross' cross compilation issues `obsolete' obsolete constructs `syntax' dubious syntactic constructs `all' all the warnings `no-CATEGORY' turn off the warnings on CATEGORY `none' turn off all the warnings `error' warnings are error The environment variable `WARNINGS' is honored. Library directories: -B, --prepend-include=DIR prepend directory DIR to search path -I, --include=DIR append directory DIR to search path Tracing: -t, --trace=MACRO report the MACRO invocations -p, --preselect=MACRO prepare to trace MACRO in a future run Freezing: -F, --freeze produce an M4 frozen state file for FILES AUTHOR
Written by Akim Demaille. Copyright 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. REPORTING BUGS
Report bugs to <bug-autoconf@gnu.org>. SEE ALSO
autoconf(1), automake(1), autoreconf(1), autoupdate(1), autoheader(1), autoscan(1), config.guess(1), config.sub(1), ifnames(1), libtool(1). The full documentation for autom4te is maintained as a Texinfo manual. If the info and autom4te programs are properly installed at your site, the command info autom4te should give you access to the complete manual. autom4te 2.57 December 2002 AUTOM4TE(1)
All times are GMT -4. The time now is 07:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy