How to run a script with options


 
Thread Tools Search this Thread
Operating Systems Solaris How to run a script with options
# 1  
Old 12-09-2008
How to run a script with options

I have a script name as psin_install_i3fp.sh

I need to run this script like ./psin_install_i3fp.sh step2

What this step2 represents?



my script contains data:
#!/bin/ksh

mkdir logs >> /dev/null 2>&1

./infra/bin/psin_stop_ba.sh
mv ./psin_start_ba.sh ./infra/bin/psin_start_ba_moved.sh >> /dev/null 2>&1
mv ./psin_stop_ba.sh ./infra/bin/psin_stop_ba_moved.sh >> /dev/null 2>&1

sleep 5

./psin_start_i3.sh

if [ -f distribution/psin_cli_UNIX.zip ] ; then
./infra/utils/unzip -o -q distribution/psin_cli_UNIX.zip > logs/infra.extract.cli.out 2>&1
fi




and also tell me the below line represnts:

mv ./psin_start_ba.sh ./infra/bin/psin_start_ba_moved.sh >> /dev/null 2>&1
# 2  
Old 12-10-2008
Quote:
Originally Posted by pmrajesh21
I have a script name as psin_install_i3fp.sh


What this step2 represents?

and also tell me the below line represnts:

mv ./psin_start_ba.sh ./infra/bin/psin_start_ba_moved.sh >> /dev/null 2>&1
The step2 represents nothing, as it is not parsed anywhere in the script you provided.


The command you asked for moves a file (see man mv for details), any output from that command is redirected to /dev/null (unix' black hole). Actually the redirection done with ,,>>'' is meaningless, single ,,>'' would suffice and do exactly the same in this case.
# 3  
Old 12-11-2008
Its a bad coding.. shouldn't have "./" in your codes, use a full path instead and also assign a variable name so that it wont be messy
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

Script fails to run properly when run from CRONTAB

Hello all, I'm trying to write a script to gather and send data and it works just fine at the bash command line, but when executing from CRON, it does not run properly. My scripting skills are pretty limited and there's probably a better way, but as I said it works at the command line, but... (12 Replies)
Discussion started by: rusman
12 Replies

3. Shell Programming and Scripting

how to run an already made script run against a list of ip addresses solaris 8 question

how to run an already developed script run against a list of ip addresses solaris 8 question. the script goes away and check traffic information, for example check_GE-VLANStats-P3 1.1.1.1 and returns the results ok. how do I run this against an ip list? i.e a list of 30 ip addresses (26 Replies)
Discussion started by: llcooljatt
26 Replies

4. Shell Programming and Scripting

Run perl script, with command-line options

Hello everyone, I have a perl script which takes various command line options from user like : test.pl -i <input_file> -o <output_file> -d <value> -c <value> Now I have multiple input files in a directory: <input_file_1> <input_file_2> <input_file_3> <input_file_4> ..... .... ...... (6 Replies)
Discussion started by: ad23
6 Replies

5. AIX

My script didn't run every run every minute at cronjob

In my cronjob, I would like to schedule my script.sh to run every minutes. I crontab -e and have in line below but it didn't seems to run at all. * * * * * script.sh When I run it manually, I can run it. Is that anything wrong with the above line? If I change it to something like below,... (4 Replies)
Discussion started by: ngaisteve1
4 Replies

6. UNIX for Dummies Questions & Answers

[solved] Script creation (how to include options in the script)

Hi guys i have written a script which takes the options given to him and execute itself accordingly. for example if a script name is doctortux then executing doctortux without option should made doctortux to be executed in automatic mode i.e. doctortux -a or if a doctortux is needed to run in... (4 Replies)
Discussion started by: pinga123
4 Replies

7. Shell Programming and Scripting

Help with shell script to run the commands reading options from local file

I have to use shell script to run series of commands on another unix box by connecting through SSH and giving user credentials. For running commands on remote machine I have to use options reading from a local file. Process: Connecting to remote unix server <host1.ibm.com> through ssh Login: ... (2 Replies)
Discussion started by: itsprout
2 Replies

8. UNIX for Advanced & Expert Users

script to run different shells which run different processes

Hi, Would like to ask the experts if anyone knows how to run a script like this: dtterm -title shell1 run process1 on shell1 dtterm -title shell2 run process2 on shell2 cheers! p/s: sorry if i used the wrong forum, quite concussed after watching world cup for several nights; but I... (2 Replies)
Discussion started by: mochi
2 Replies
Login or Register to Ask a Question