Sponsored Content
Top Forums Shell Programming and Scripting To trigger script on particular instance Post 303026269 by nezabudka on Friday 23rd of November 2018 04:12:10 AM
Old 11-23-2018
cat test.config
Code:
apple=12345
mango=123456
orange=1234567

cat main_script.sh
Code:
#!/bin/bash

wd=$(date +%u)
for i in $(cat test.config); do
        if [[ ${i/*=} =~ $wd ]]; then
                echo ${i/=*}
        fi
done

These 2 Users Gave Thanks to nezabudka For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script call from a DB trigger

Has anybody been able to execute a shell script call from a database trigger? If so what are the steps to execute it? Do we have any specific packages in Oracle? Reards, Rahul. (1 Reply)
Discussion started by: rahulrathod
1 Replies

2. Shell Programming and Scripting

Check if trigger Script is running

HI, I have a script which will be running all the time...it is like a trigger.. wakesup every 10 minutes(trigger.sh) executes, and I want to write another script which monitors this script every one hour and if it finds that trigger script is not running it should start it and exit...and here... (9 Replies)
Discussion started by: mgirinath
9 Replies

3. Shell Programming and Scripting

Trigger Shell Script from Current Script

Hello all, I'm new to shell programming and need some help. I would like to set up a step within a shell script to trigger another shell script to run, based on the highest return code generated in the current script. For example, if the highes return code value in the current script is less... (1 Reply)
Discussion started by: mmignot
1 Replies

4. UNIX for Dummies Questions & Answers

Can we trigger an shell script on an event

Hi, My program A updates a log called logA. I have a shell script S that is responsible to send emails reading from the log. I want to trigger execution of the script whenever there is an update to the log. Thanks in advance. (8 Replies)
Discussion started by: cv_pan
8 Replies

5. Shell Programming and Scripting

Trigger a script by consequtive scripts in crontab

Hello Friends, I've been searching solutions for an exceptional backup case recently, I need someone to guide me, suggest a method pls. In a production system we have backup scripts, they are run by cron one after another, and monthly. There is 1 hour difference between each consecutive script... (1 Reply)
Discussion started by: EAGL€
1 Replies

6. Shell Programming and Scripting

Execute shell script from plsql trigger

Hi, I have been assigned a job which requires me to send mails from unix(Mailx) upon on certain actions triggered in the database. On insert/update of a certain field into one of the database tables the shell script present in Unix box responsible to send mail though mailx needs to be triggered... (7 Replies)
Discussion started by: hemant.bs11
7 Replies

7. Shell Programming and Scripting

Shell script trigger using http interface

Hi I have created a shell program, which takes a series of parameters as shown in the below code. Its working good from terminal. My program restorejob.sh -g <NAME> -p <Path-to-search> -r <Path-to-restore> Its working fine from bash shell. I want to extend this functionality like... (1 Reply)
Discussion started by: rakeshkumar
1 Replies

8. Shell Programming and Scripting

Automatic script trigger

Hi, I'm looking for a way to solve the following scenario: A shell should automatically trigger / run when a text file is placed or present at a specific location. My idea - to create a cron / anacron for every minute and inside that i will call a temp script. Temp script will move to my... (9 Replies)
Discussion started by: Gautham
9 Replies

9. Shell Programming and Scripting

Trigger the execution of a script on SFTP Disconnect

Hi Guys, I suspect what I'm trying to do isn't possible, but I'm hoping someone can either confirm this or point me in the right direction. We have a third-party application which transfers a collection of files to our SFTP server ( Ubuntu 12.04 with OpenSSH ) . Once the app disconnects, we... (13 Replies)
Discussion started by: jamesdrinkwater
13 Replies

10. Shell Programming and Scripting

Trigger script based on condition

Hi Guys, I am having below code which runs based on condition, Is it possible to check condition at the time of trigger code=$1 if ;then nohup sh script.sh $val 1 & fi I need to trigger if the $code = JP then only to trigger nohup sh script.sh $val 1 & My try but wanted... (4 Replies)
Discussion started by: Master_Mind
4 Replies
falcon(1)                                                       Falcon User Manuals                                                      falcon(1)

NAME
falcon - The Falcon Programming Language command line interpreter SYNOPSIS
falcon [options] [main_script] [script_options] DESCRIPTION
The falcon command line interpreter is used to launch, compile, assemble or debug scripts written in the Falcon Programming Language. The command line interpreter pushes the core module and the rtl module in the script load table, so they are available by default to all the scripts. The default operation is that of launching the given script, or read it from the standard input if the script name is not given. By default, falcon saves also the compiled module of the script in the same directory where it is found, changing the extension to ".fam". The main_script can be a "logical" module name, a relative path or an absolute path. In case it's a logical module name, that is, a script name without extension nor leading path, it is searched through the load path. The default load path is determined by the compilation options of the interpreter, and usually it includes the current directory. The environment variable FALCON_LOAD_PATH and the command line option -L can change the default module search path. When the main module is found, its path is added to the module search path; in other words, there isn't any need to specify the path con- taining the main module to have other modules in its same directory to get loaded. The main module and other source Falcon module it loads can be stored in a directory that is not listed in the module search path; indicating an absolute or relative path as the main_script parameter will add that path on top of the active search path. If not differently specified, falcon will search for .fam modules newer than the relative .fal source scripts and will load those ones instead of compiling the sources. Options past the script name will be directly passed in the args[] global variable of the script. The interpreter is compatible with the UNIX script execution directive "#!". A main script can have on the very first line of the code the directive #!/path/to/falcon to declare to the shell that the falcon command line is to be loaded. If falcon command line interpreter is also in the system PATH envi- ronment variable, which is usually the case of a normal installation, then the interpreter directive may also be simply #!/bin/env falcon It is then simply necessary to make the main script executable with chmod 744 script_name to be able to call the script directly. Scripts executed in this way will add their path to the falcon module load path as soon as they are loaded, so other modules referenced by them will be searched in the directory where they resides before being searched elsewhere. Options to the falcon compiler may be passed normally by writing them after the execution directive in the main script. Since version 0.8.12, the falcon command line interpreter has also an interactive mode which accepts statements and provide results as the expressions are evaluated. OPTIONS
-c Compile but do not execute. This makes falcon to compile the given module into a .fam file and then terminate. By default, the .fam file is written to a file with the same name as the input one, with the .fam extension. -C Check for memory leaks in VM execution. Like the -M option of faltest, this function sets the falcon engine memory allocators to slower functions that checks for memory to be allocated and deallocated correctly during the execution of a module. If the script is executed, before Falcon exits it writes a small report to the standard output. -d <directive>=<value> Sets the given directive to the desired value. Compilation directives and their values are the ones that scripts can set through the directive statement. -D <constant>=<value> Sets the given constant to the desired value. Constants are made available at compile time, and can be employed in macro and meta compilation. -e <enc> Set given encoding as default for VM I/O. Unless the scripts select a different I/O encoding, the streams that are provided to the falcon VM (like the output stream for printf) are encoded using the given ISO encoding. This overrides the default encoding that is detected by reading the environment settings. In example, if your system uses iso-8859-1 encoding by default, but you want your script to read and write utf-8 files, use the option -e utf-8 The -e option also determines the default encoding of the source files. To override this, use -E -E <enc> Set source script encoding. As -e , but this determines only the encoding used by falcon when loading the source scripts. This options overrides -e values, so it can be used to set the script encoding when they have to read and write from different encodings. -f Force recompilation of modules even when .fam are found. -h or -? Prints a brief help on stdout and exits. -i Interactive mode. Falcon interpreter reads language statements from a prompt and present evaluation results to the user. -l <lang_code> Select a different language code for internationalized programs. This option loads an alternate string table for all the modules loaded. If the table doesn't exist or if the modules doesn't have a .ftr file containing the translation, the operation silently files and the original strings are used instead. Language codes should be in the international ISO format of five characters with a language name, an underscore and the regional code, like in en_US -L <path> Changes the default load path. This overrides both the internal built in settings and the contents of environment variable FAL- CON_LOAD_PATH. Each directory in the path should be separated by ";" and use forward slashes, like this: falcon -L -m Use temporary files for intermediate steps. By default compilation is completely performed in memory; this option makes falcon to use temporary files instead. -M Do NOT save the compiled modules in '.fam' files. -o <fn> Redirects output to <fn>. This is useful to control the output of falcon when using options as -c, -a, -S etc. If <fn> is a dash (-) the output is sent to stdout. -p <module> Preloads the given module as if it were loaded by the main script. -P Ignore default load paths and uses only the paths set via the -L switch. -r Ignore source files and only use available .fam. This does not affects the main script; use the -x option if also the main script is a pre-compiled .fam module and source script must be ignored. -S Produce an assembly output. Writes an assembly representation of the given script to the standard output and the exit. Use -o to change file destination. -t Generates a syntactic tree of the source and writes it to the standard output, then exits. The syntactic tree is a representation of the script that is known by the compiler and used by the generators to create the final code. This option is useful when debugging the compiler and to test for the correct working of optimization algorithm. -T Force input parsing as .ftd (Falcon Template Document). Normally, only files ending with ".ftd" (case sensitive) are parsed as tem- plate document; when this switch is selected, the input is treated as a template document regardless of its name. -v Prints copyright notice and version and exits. -w After execution, requires the user to confirm program termination by pressing <enter>. This helps in point & click environments, where Falcon window is closed as soon as the program terminates. -x Executes a pre-compiled .fam module. -y Creates a template file for internationalization. This option creates a single .ftt file from a single source, .fam module or binary module. By default, the name of the template is the same as the module plus ".temp.ftt" added at the end; it is possible to change the destination template file using the -o option. FILES
/usr/lib/libfalcon_engine.so Default location of the Falcon Engine loadable module. /usr/lib/falcon Default directory containing Falcon binary modules. ENVIRONMENT
FALCON_LOAD_PATH Default search path for modules loaded by the scripts. FALCON_SRC_ENCODING Default encoding for the source scripts loaded by falcon (when different from the system default). FALCON_VM_ENCODING Default encoding for the VM I/O streams (when different from system default). AUTHOR
Giancarlo Niccolai <gc@falconpl.org> SEE ALSO
falrun(1) faldisass(1) fallc.fal(1) LICENSE
This document is released under the "GNU Free Documentation License, version 1.2". On Debian systems, the complete text of the Free Docu- mentation License, version 1.2, can be found in /usr/share/common-licenses/. Falcon toolset April 2007 falcon(1)
All times are GMT -4. The time now is 04:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy