Sponsored Content
Full Discussion: how to run scripts....
Top Forums Shell Programming and Scripting how to run scripts.... Post 302389084 by tlarkin on Friday 22nd of January 2010 02:18:40 PM
Old 01-22-2010
This is what I do in my enterprise (OS X Sys admin). I create scripts that need to be run, and their dependencies and copy them into each client locally in a folder under /Library/Scripts/mycompany. That is where every script I ever need to call lives.

Then if I have multiple scripts, like if I have a comparison bracket with an if/then statement and it needs to call two other scripts I will just hard code the full path to my script, which is always /Library/Scripts/mycompany/name_of_script.sh

That way I can centralize it, put it in a directory owned as root. Then I can use launch agents (like cron, or init.d) run these scripts based on how I tell it to.

If I add a script to trigger a log in hook in each user's .bash_profile or in their home directory launchd looks at (this is particular to Mac OS X) it may call for other scripts in /Library/Scripts/mycompany.

It just depends on what you are trying to accomplish here.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to run three scripts one after another automatically???

Hi !! How do u run three scripts one after another automatically using crontab command at some specified regular interval. Say i have three scripts A,B,C and i want to run the three scripts A followed by B followed by C. REQUIRE HELP URGENTLY Thanks in advance Arunava . (3 Replies)
Discussion started by: arunava_maity
3 Replies

2. Shell Programming and Scripting

Run scripts within a script..

Hi all... I have several scripts of varying types (shell script, expect script, awk script) that I would like to run within 1 script.. They also take a command line argument (which it is getting successfully). The problem is, the parent script is exiting after the first script it calls is... (2 Replies)
Discussion started by: earnstaf
2 Replies

3. Shell Programming and Scripting

Can't get Cygwin to run scripts

I haven't been on a unix system in a long time and I'm trying to teach a friend unix. After looking at/testing various options cygwin seemed to be the easiest to download and install. Everything works pretty much as I recall and I even tested a small java program on it. I can't seem to get... (4 Replies)
Discussion started by: mmtemp
4 Replies

4. AIX

To run scripts

How to run a script from any directory? Should i include any environment or wat should i start with in writing a script ? (1 Reply)
Discussion started by: rollthecoin
1 Replies

5. Shell Programming and Scripting

telnet and run scripts

Hello folks, I've got this script which connects to different boxes and executes a certain script in those locations. The following is the line from where i am trying to do this: (sleep 1; echo $USERID ; sleep 1; echo $PASSWD ; sleep 1 ; echo y ; sleep 1 ; echo "\r" ; sleep 1 ; echo "cd... (1 Reply)
Discussion started by: Rajat
1 Replies

6. Shell Programming and Scripting

background scripts run-help

Looking for a logic where say i have a script called parent_script which is used to call other 4 to 5 child scripts in background as.. cat parent_script # containing 65 lines 1 2 .. 35 while read child_script 36 do 37 ./child_script_name& 38 done< ${SCRIPT_LISTS} 39 40 # Need to have... (2 Replies)
Discussion started by: michaelrozar17
2 Replies

7. UNIX for Dummies Questions & Answers

Scripts can be run manually but couldn't run with cronjobs

I am from MQ/MB technology. My requirement is to display the queue manger and broker status on daily basis. If I manually run the script, it works fine and displays output. But when I have scheduled the same using cronjobs it shows only the queue manger status and not the broker status. Can... (3 Replies)
Discussion started by: Anusha M
3 Replies

8. Shell Programming and Scripting

How to run a sequence of scripts?

Assume I want to run a sequence of scripts: script0001.sh script0002.sh script0003.sh ... script0122.sh script0123.sh I only know a little Linux scripting, so the following is the best I can write for k in $(seq 1 123) do ./script${k}.sh done Of course it doesn't work... (2 Replies)
Discussion started by: zzzhhh
2 Replies

9. Shell Programming and Scripting

Run scripts in background one by one

Hello all, Can someone help with one script? I have as example 3 scripts 1.sh sleep 60 & sleep 60 & sleep 10 & sleep 80 & sleep 60 & 2.sh sleep 40 & sleep 5 & sleep 10 & sleep 70 & sleep 60 & 3.sh (2 Replies)
Discussion started by: vikus
2 Replies

10. UNIX for Beginners Questions & Answers

To run multiple scripts

Hi , Can someone help! I need a shell script to run multiple scripts by using single shell script, incase any one of the scripts fails, it should get exit and after trouble shooting if we re-execute it, it should start from the failed script (4 Replies)
Discussion started by: anniesurolyn
4 Replies
filetest(3pm)						 Perl Programmers Reference Guide					     filetest(3pm)

NAME
filetest - Perl pragma to control the filetest permission operators SYNOPSIS
$can_perhaps_read = -r "file"; # use the mode bits { use filetest 'access'; # intuit harder $can_really_read = -r "file"; } $can_perhaps_read = -r "file"; # use the mode bits again DESCRIPTION
This pragma tells the compiler to change the behaviour of the filetest permissions operators, the "-r" "-w" "-x" "-R" "-W" "-X" (see perl- func). The default behaviour to use the mode bits as returned by the stat() family of calls. This, however, may not be the right thing to do if for example various ACL (access control lists) schemes are in use. For such environments, "use filetest" may help the permission operators to return results more consistent with other tools. Each "use filetest" or "no filetest" affects statements to the end of the enclosing block. There may be a slight performance decrease in the filetests when "use filetest" is in effect, because in some systems the extended func- tionality needs to be emulated. NOTE: using the file tests for security purposes is a lost cause from the start: there is a window open for race conditions (who is to say that the permissions will not change between the test and the real operation?). Therefore if you are serious about security, just try the real operation and test for its success - think in terms of atomic operations. subpragma access Currently only one subpragma, "access" is implemented. It enables (or disables) the use of access() or similar system calls. This extended filetest functionality is used only when the argument of the operators is a filename, not when it is a filehandle. perl v5.8.0 2002-06-01 filetest(3pm)
All times are GMT -4. The time now is 07:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy