Sponsored Content
Full Discussion: input parameters pls help!
Top Forums Shell Programming and Scripting input parameters pls help! Post 302107709 by yarik20 on Tuesday 20th of February 2007 08:24:20 AM
Old 02-20-2007
Thank you so much, i'll test it from work.

Quote:
Originally Posted by aigles
You can do something like that :
Code:
##!/bin/bash

SCRIPT_DIR=$(dirname $0)
SCRIPT_DIR=$(cd $SCRIPT_DIR && pwd)
DATA_DIR=${SCRIPT_DIR}/../../installer/data/
SOURCE_DIR_MAINT=/cygdrive/c/maint_view/RBS

# Get parameters

if [ $# -lt 2 ]
then
   echo "Usage: $0 label database_string" 1>&2
   exit 1
fi
Label=$1 ; shift
Database_string="$*"          


echo "######################UPDATING MAINTANANCE VIEW##########################  "
#update view
(cd $SOURCE_DIR_MAINT; cleartool update) >log.lst

cd $DATA_DIR
cleartool find . -name '*.sql' -cview -version "{!lbtype(${Label})}' -nxname -print | \
sed -e 's/[.]\\//g' -e 's/_data[.]sql//g'                                           | \
sort >file.lst

echo ===============================================================================================
for f in `cat file.lst`; do count=$(grep "insert into" ${f}_data.sql|wc -l); echo "$f,$count"; done
echo ===============================================================================================

echo "set heading off;" >counter.sql
for f in `cat file.lst`; do echo "select '$f,'||count(*) from $f;" ; done >>counter.sql
echo "quit" >> counter.sql
cat counter.sql
for f in `cat file.lst`; do count=$(grep "insert into" ${f}_data.sql|wc -l); echo "$f,$count"; done >version_controlcount.txt
sqlplus -S ${Database_string} | sed -e '/^$/d' >db_count.txt
cat db_count.txt
diff version_control_count.txt db_count.txt
exit 0

Jean-Pierre.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Accept input parameters

Dear All, I got a table creation file in a standard format. I need to accept parameters from the user & then based on the input change the data in the file. For. eg. i will accept the database name, dbspace name & user name from the user and accordingly change the same in the table creation... (2 Replies)
Discussion started by: lloydnwo
2 Replies

2. Shell Programming and Scripting

Input parameters

I have a script which take 3 input parameters 1st - a date (i.e. current date) 2nd - type (i.e. A) 3rd - limit (i.e. 40) normally the date parameter would be current date, so I thought I could do this calculate.sh $(date +%Y-%m-%d) A 40 however, it seems like it can't be done,... (3 Replies)
Discussion started by: mpang_
3 Replies

3. Shell Programming and Scripting

Validating Input parameters

Hi All, I have tried to use ckdate (sun) command in script. It checks the input parameter which should be in 'YYYYMMDD format. date=$( echo $1 | ckdate -f "%Y%m%d") | true if ] then print " success" else print "no success" fi But in whatever format i pass the parameter,... (3 Replies)
Discussion started by: Amit.Sagpariya
3 Replies

4. Shell Programming and Scripting

Verify input parameters

I have to write a script to verify input parameters; say esr should be YES or NO other wise the script should print an error. This is what i tried in my script but I get the following error : esr="YES" if ; then print " Error should specify esr options YES/NO" else esr =$esr fi ... (2 Replies)
Discussion started by: ramky79
2 Replies

5. Shell Programming and Scripting

Problem with Input parameters

Hi, I am facing a weird problem with input parameters. Please find more details about my problem below: a) I am executing a korn shellscript with 11 input parameters from "Appworx" tool (it's a scheduling tool) and immediately displaying those 11 parameter values in unixscript and noticed... (4 Replies)
Discussion started by: npk2210
4 Replies

6. Shell Programming and Scripting

How to validate input parameters?

Hi, I wonder how I can know if the input parameters to the script are numbers or text Thanks (11 Replies)
Discussion started by: Gengis-Kahn
11 Replies

7. Shell Programming and Scripting

Problem with input parameters

Hi I wrote a script which lists the content of a given directory. I have just one problem. If you give 2 or more parameters, then it gives a strange error. After that error, it gives also an error from my script, but normally it shouldn't give that error. Here's my script.You can test it. ... (3 Replies)
Discussion started by: hss
3 Replies

8. Shell Programming and Scripting

How can I take input parameters after the first one?

Hi, Is there a simple way to take input of parameters after the first one? As following example, if I assign others=$2, it only takes the second one, if I assign others=$@, it will include the first one. I may try to assign others="$2 $3 $4 $5 $6 $7 $8 $9", it looks very ugly and could missing... (1 Reply)
Discussion started by: hce
1 Replies

9. AIX

Input parameters

friends and I can validate whether to run the shell has input parameters m event date, I occasionally happen something like this does not work if $ 1 is null then echo has entered input parameters else echo "parameter ok" fi (2 Replies)
Discussion started by: tricampeon81
2 Replies

10. Shell Programming and Scripting

Pls HELP: Redirecting input to SFTP connection

Hi, Can somebody please let me know if we can redirect variable value to the sftp connection. I am trying to run the attached snippet but facing an error. dev@UAT.com> export USER1=ftp dev@UAT> export HOST1=XX.XX.XX.XX dev@UAT> export INPUTDATA2='lcd /Z02/apps/output/UAT/CMUP/incoming cd... (9 Replies)
Discussion started by: Khan28
9 Replies
mcx clcf(1)							  USER COMMANDS 						       mcx clcf(1)

  NAME
      mcx clcf - compute the clustering coefficient of a graph

  SYNOPSIS
      mcx clcf [options] [matrix-file]

      mcxclcf  is not in actual fact a program. This manual page documents the behaviour and options of the mcx program when invoked in mode clcf.
      The options -h, --apropos, --version, -set, --nop, -progress <num> are accessible in all mcx modes. They are described  in  the  mcx  manual
      page.

      mcx clcf [-abc <fname> (specify label input)] [-imx <fname> (specify matrix input)] [-tab <fname> (use tab file)] [-o <fname> (write to this
      file)] [-t <int> (use <int> threads)] [-J <intJ> (a total of <intJ> jobs are used)] [-j <intj>  (this  job  has  index  <intj>)]	[--summary
      (return mean clustering coefficient)] [-h (print synopsis, exit)] [--apropos (print synopsis, exit)] [--version (print version, exit)]

  DESCRIPTION
      mcx clcf computes the clustering coefficient of a graph.

      The  input  graph/matrix,  if specified with the -imx option, has to be in mcl matrix/graph format. You can use label input instead by using
      the -abc option.	Refer to mcxio(5) for a description of these two input formats.  By default mcx diameter  reads  from  STDIN  and  expects
      matrix format.  To specify label input from STDIN use -abc -.

  OPTIONS
      -abc <fname> (label input)
	The file name for input that is in label format.

      -imx <fname> (input matrix)
	The file name for input. STDIN is assumed if not specified.

      -o <fname> (output file)
	The file name for output. STDOUT is the default output stream.

      -tab <fname> (use tab file)
	This  option causes the output to be printed with the labels found in the tab file.  With -abc this option will, additionally, construct a
	graph only on the labels found in the tab file.  If this option is used in conjunction with -imx the tab domain and the matrix domain  are
	required to be identical.

      --summary (return mean clustering coefficient)
	By  the  default a 1-column table (with row names included) is output, one row for each node. This option causes the output of the average
	clustering coefficient only.

      -t <int> (use <int> threads)
      -J <intJ> (a total of <intJ> jobs are used)
      -j <intj> (this job has index <intj>)
	Computing clustering coefficients is time-intensive for large graphs. If you have multiple CPUs available consider using as many  threads.
	Additionally  it  is possible to spread the computation over multiple jobs/machines. Conceptually, each job takes a number of threads from
	the total thread pool. If job control is used (the -J option is used) then the number of jobs should not exceed  the  number  of  threads.
	The  total number of threads divided by the total number of jobs defines the number of threads that will be used by the current job. Addi-
	tionally, the number of threads specified signifies the total added amount of all threads across all machines and must be the same for all
	jobs.  This  number is used by each job to infer its own set of tasks. The following set of options, if given to as many commands, defines
	three jobs, each running four threads.

	-t 12 -G 3 -g 0
	-t 12 -G 3 -g 1
	-t 12 -G 3 -g 2

  SEE ALSO
      mcxio(5), and mclfamily(7) for an overview of all the documentation and the utilities in the mcl family.

  mcx clcf 12-068						      8 Mar 2012							 mcx clcf(1)
All times are GMT -4. The time now is 07:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy