Sponsored Content
Full Discussion: Passing parameters in script
Top Forums UNIX for Dummies Questions & Answers Passing parameters in script Post 4831 by eliguy on Wednesday 1st of August 2001 01:08:00 PM
Old 08-01-2001
Question Passing parameters in script

I have 2 scripts: script1 and script2

Script1 passes 4 parameters to script2 as follows
#script1
code
...
...
script2 $var1 $var2 $var3 $var4

Script2 uses the export command to know to expect these values
#script2
export $1 $2 $3 $4
code
...
...

The problem that I am having is that some of the values I am passing either have spaces or special characters in them and I get the error (specifically for dates):
script2: 5/7/99: is not an identifier

Any suggestions?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

passing parameters from a shell script to sqlplus

Hi , I want to pass parameters from a shell script to a sql script and use the parameter in the sql query ..and then I want to spool a particular select query on to my unix box... for 4 different locations by writing only one sql script Right now no file is generated on the unix box...it is a... (2 Replies)
Discussion started by: phani
2 Replies

2. Programming

Passing Parameters and getting values back from a c program to Shell script

I am having a shell script which has to be called from a C program. I have to pass two parameters to this script. HOw can I do that? eg: int main() { char st1; char str2; // call a shell script call_sh(str1,str2) where call_sh is the name of the shell script. then i need to get the return... (5 Replies)
Discussion started by: Rajeshsu
5 Replies

3. Shell Programming and Scripting

Random parameters passing in FTP script

Hi I have a question. In the FTP script if we are passing all the required value like Hostname, username, password, Action(put or get), Filename, & mode(ascii or binary) through parameters then we have to pass these in the exact orders in which they are taken like if we defined Username=$2... (2 Replies)
Discussion started by: sourabhshakya
2 Replies

4. Shell Programming and Scripting

Passing parameters to Shell script for GREP command

I am using grep to capture date from a file . Since i need to use the shell script for different dates ,is it possible to pass the date parameter to the shell script the Script is as below grep -E "08 Aug 2008|2008-08-08"* somefile.txt>test.txt The above script file greps the... (1 Reply)
Discussion started by: sud.tech
1 Replies

5. Shell Programming and Scripting

Shell Script Passing Parameters For Directory Listing

i have this basic piece of code that i am trying to debug to accept input parameter to be able to display a directory listing of files. cd /u02/app/eatv/dev/out CURDIR=`pwd` echo directory listing of $CURDIR echo if ; then ls -latr else ls -latr $1 fi basically if the script... (9 Replies)
Discussion started by: wtolentino
9 Replies

6. Shell Programming and Scripting

passing parameters from a script to a datastage job

We have a requirement as follows. We have created a datastage job that will be doing the select operation from table (select query from a table). The datastage job is being invoked by a unix shell script(ksh). We are passing the "table name (STUD_DETAILS)" and a "where clause condition... (4 Replies)
Discussion started by: kmanivan82
4 Replies

7. Shell Programming and Scripting

Passing parameters to bash script function (or subroutine)

I've found a few posts regarding passing parameters to a function or subroutine, but for some reason when I try to run a command based on part with these parameters it's not working. If I have the function echo the parameters they show correctly so I believe they are being passed right but the... (2 Replies)
Discussion started by: withanh
2 Replies

8. Shell Programming and Scripting

passing parameters to the script

how can i make a script to run only when parameters are given, if parameters are not given it should through an error , saying "please enter a parameter" for ex: i want a find command to run only when the parameters are given (4 Replies)
Discussion started by: knip
4 Replies

9. Shell Programming and Scripting

Shell Script passing parameters to sqlplus code

Hello All, I am interested in finding out a way to pass parameters that are entered at the prompt from HP unix and passed to SQLPlus code with a Shell Script. Is this possible? Thanks (4 Replies)
Discussion started by: compprog11
4 Replies

10. Shell Programming and Scripting

Passing command line parameters into script

Not a good post. (1 Reply)
Discussion started by: bash_in_my_head
1 Replies
rcov(1) 						    rcov test coverage analysis 						   rcov(1)

NAME
rcov - create a code coverage report for Ruby tests SYNOPSIS
rcov [options] <script1.rb> [script2.rb] [-- --extra-options] DESCRIPTION
rcov is a code coverage tool for Ruby. It creates code coverage reports showing the unit test coverage of the target code. rcov does "statement coverage", also referred to as "C0 coverage analysis". It tests, if each line of the source code has been executed. rcov is typically used to find the areas of a program that have not been sufficiently tested. It reports, what code has not been run by any test cases. It can easily be integrated into build processes (e.g. with rake or rant) and creates the coverage reports in HTML or text format. OPTIONS
-o, --output Destination directory. -I, --include PATHS Prepend PATHS to $: (colon separated list) --[no-]comments Mark all comments by default. (default: --no-comments) --test-unit-only Only trace code executed inside TestCases. --spec-only Only trace code executed inside RSpec specs. -n, --no-color Create colorblind-safe output. -i, --include-file PATTERNS Generate info for files matching a pattern (comma-separated regexp list) -x, --exclude PATTERN Don't generate info for files matching a pattern (comma-separated regexp list) --exclude-only PATTERNS Skip info only for files matching the given patterns. --rails Skip config/, environment/ and vendor/. --[no-]callsites Show callsites in generated XHTML report. (somewhat slower; disabled by default) --[no-]xrefs Generate fully cross-referenced report. (includes --callsites) -p, --profile Generate bogo-profiling info. -r, --range RANGE Color scale range for profiling info (dB). -a, --annotate Generate annotated source code. -T, --text-report Dump detailed plain-text report to stdout. (filename, LoC, total lines, coverage) -t, --text-summary Dump plain-text summary to stdout. --text-counts Dump execution counts in plaintext. --text-coverage Dump coverage info to stdout, using ANSI color sequences unless -n. --gcc Dump uncovered line in GCC error format. --aggregate FILE Aggregate data from previous runs in FILE. Overwrites FILE with the merged data. FILE is created if necessary. -D, --text-coverage-diff [FILE] Compare code coverage with saved state in FILE, defaults to coverage.info. Implies --comments. --save [FILE] Save coverage data to FILE, for later use with rcov -D. (default: coverage.info) --[no-]html Generate HTML output. (default: --html) --css relative/path/to/custom.css Use a custom CSS file for HTML output. Specified as a relative path. --sort CRITERION Sort files in the output by the specified field (name, loc, coverage) --sort-reverse Reverse files in the output. --threshold INT Only list files with coverage < INT %. (default: 101) --failure-threshold [INT] Fail if the coverage is below the threshold (default: 100) --charset CHARSET Charset used in Content-Type declaration of HTML reports. --only-uncovered Same as --threshold 100 --replace-progname Replace $0 when loading the .rb files. -w Turn warnings on (like ruby). --no-rcovrt Do not use the optimized C runtime. (will run 30-300 times slower) --diff-cmd PROGNAME Use PROGNAME for --text-coverage-diff. (default: diff) -h, --help Show extended help message --report-cov-bug SELECTOR Report coverage analysis bug for the method specified by SELECTOR (format: Foo::Bar#method, A::B.method) --version Show version EXAMPLES
To simply run rcov on all ruby files in the current directory and create a HTML coverage report in ./coverage: rcov *.rb To run the tests in ./tests, include ./lib, only take care of code executed from TestCases and output a summary to STDOUT: rcov --test-unit-only -t -I./lib ./tests/*.rb SEE ALSO
runit(1), rake(1), rant(1) http://github.com/relevance/rcov Full Documentation about the integration into other tools is available in /usr/share/doc/rcov/README.* AUTHOR
The manpage is provided by Micah Anderson <micah@debian.org> as part of the Debian's rcov package. Upstream author of rcov is Mauricio Fer- nandez <mfp@acm.org>. All the option descriptions have mainly be taken from the help output of rcov. rcov 0.8.1.2 2007-11-22 27 April 2008 rcov(1)
All times are GMT -4. The time now is 05:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy