Sponsored Content
Top Forums Shell Programming and Scripting Make script that run with argument if not run from configuration file argument Post 302568082 by rohit22hamirpur on Wednesday 26th of October 2011 07:21:49 AM
Old 10-26-2011
Make script that run with argument if not run from configuration file argument

Hello,

Is there any method thorugh which script can take argument if pass otherwise if argument doesn't pass then it takes the argument from the configuration file

i.e I am workiing on a script which will run through crontab and the script will
chekout the code ,zip and copy to the particular location.

But the script should be in this way

if someone pass the argument then it will checkout that code else if argument doesn't pass then it will take the argument from the configuration file.

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to make a script to run everytime a new file is copied into a directory??

Hi folks I have a unix script script1 in a directory folder1 and also I have few input log files in this directory. My input log files will be copied into this directory folder1 from the portable thumb drive. Now what I want is I need to run this script1 whenever any new file is copied... (2 Replies)
Discussion started by: ks_reddy
2 Replies

2. Shell Programming and Scripting

get positive number n as argument script must calculate the factorial of its argument

Can someone please help me with this SHELL script? I need to create a script that gets a positive number n as an argument. The script must calculate the factorial of its argument. In other words, it must calculate n!=1x2x3x...xn. Note that 0!=1. Here is a start but I have no clue how to... (3 Replies)
Discussion started by: I-1
3 Replies

3. Shell Programming and Scripting

Run with argument

I have created shell script to run sql query something like below. i can use this script with only few arguments. But how can i modify the script if empno is huge in numbers. For example ./script.ksh 1234 select * from emp where empno in $1 (2 Replies)
Discussion started by: ford2020
2 Replies

4. Shell Programming and Scripting

Need to run the script by argument passing

Hi All, I have a question regarding running this script by passing an argument, for example ./ShellParse.sh sun, how do i do that? So i want when i pass argument sun, it shouild execute things inside the for loop. I want to support some other platforms too, so there are more for loops to... (3 Replies)
Discussion started by: asirohi
3 Replies

5. Shell Programming and Scripting

How to use perl to run bash with argument?

Hi All, I want to run a bash script using perl. But they are in the different dir. #! /usr/bin/perl -w use strict; my $root=`pwd`; chomp($root); my $cmd=".$root/testdir/ft_623.sh 3 4 5 6 7"; print $cmd; my @line=`$cmd`; foreach (@line){ print $_; } ft_623.sh (0 Replies)
Discussion started by: Damon sine
0 Replies

6. Shell Programming and Scripting

Cannot compare argument in if statement in csh/grep command if argument starts with “-“

If ($argv == “-debug”) then Echo “in loop” Endif But this is not working. If I modify this code and remove “-“, then it works. Similarly I am getting problem using grep command also Grep “-debug” Filename Can someone please help me on how to resolve these... (1 Reply)
Discussion started by: sarbjit
1 Replies

7. UNIX for Advanced & Expert Users

Error:--test: argument expected--Even though i give an argument.

Hi All, I am running the script VBoxManage list vms |sed 's/"//g' | cut -d " " -f1 > har1out.mytxt result=`cat har1out.mytxt | grep $1' echo $result echo $1 { if then echo pass else echo fail fi (2 Replies)
Discussion started by: harsha85
2 Replies

8. Shell Programming and Scripting

help to make script run recursively

I have this little bash script I use to transcode mkv files using handbrake. #!/bin/bash sourcedir="/media/raid10/video/to_be_encoded_series" destdir="/media/raid10/video/series" cd "$sourcedir" for i in *.mkv; do HandBrakeCLI -i "$i" -o "$destdir/${i%.*}.mkv" -e x264 -q 20.0 -E copy -B... (4 Replies)
Discussion started by: barrydocks
4 Replies

9. Shell Programming and Scripting

Pass argument in script to run specific part in that

Hello Friends, I need you help ! I have a scripts names runsteps.sh which contains command to run bunch of commands for each application you want to install " Oracle " Jboss" etc echo " Which app you want to install Jboss" ? Yes or no? read ans depending on Yes or not it goes inside... (3 Replies)
Discussion started by: saurabh84g
3 Replies

10. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies
LATD.CONF(5)							File Formats Manual						      LATD.CONF(5)

NAME
latd.conf - LAT configuration file SYNOPSIS
/etc/latd.conf DESCRIPTION
/etc/latd.conf is a shell script (run by /bin/sh) that is run when latd is started up using the latcp -s command. It contains commands used to customise lat for your site and usually consists of a list of latcp commands. latd.conf is run with a minimal PATH and a minimal environment. The variable $LATCP points to the latcp binary used to invoke the script. EXAMPLE # /etc/latd.conf # This is a sample configuration file for latd # it is run as s shell script from latcp -s with a minimal # environment and PATH. latcp should be invoked using the # environment variable $LATCP. # # You can fiddle with all the latd parameters you like in here, # the first service announcement will not be made until this # script completes. # # Set the multicast timeout to 30 seconds $LATCP -m 30 # Add another login service $LATCP -A -a ZAPHOD -r 100 # Add a queued reverse LAT service to a printer on a DECserver $LATCP -A -p /dev/lat/printer -Hdecserver -Vdecserver -Q # Only advertise our service in groups 1-10 and 200 $LATCP -G 1-10,200 exit SEE ALSO latcp(8), latd(8) LAT Server June 2 2000 LATD.CONF(5)
All times are GMT -4. The time now is 06:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy