Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to pass the parameter value to a... ? Post 302496574 by khestoi on Monday 14th of February 2011 12:32:17 PM
Old 02-14-2011
Both method works.
Thanks!

I have a question regarding DGPickett's suggestion. How do i use that method if i have a text file which doesnt have a "." on it? So if the script encountered a line like that it will just append the number.

By the way, i used the ${line#*.} , ${line%%.*} method.

Last edited by khestoi; 02-14-2011 at 01:45 PM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Pass Parameter to Another Script

I have a piece of code that I do not want to continuously repeat. I want to call script2 from script1 and pass a parameter. Here is an example: Script1: ....... nohup ./Script2 PARAMETER ....... Script2: if # Checks if any params. then echo "No parameters passed to function." ... (4 Replies)
Discussion started by: rvprod
4 Replies

2. UNIX for Dummies Questions & Answers

PASS parameter to AWK

Hi, Can i pass a parameter(not a file name) as a parameter to a awk program? eg; $awk -f test 1 2 3 here test is the filename...and 1,2,3 are the i/p parameters? thank you:-) (2 Replies)
Discussion started by: unisam
2 Replies

3. Shell Programming and Scripting

Pass parameter into script

I would like to write a scirpt a.sh that it first checks the first parameter of the input. If it fulfill some condition ,then run an executable program b by using all the parameter. ie. > ./a.sh 10 20 30 40 50 Then a.sh first checks the first parameter, 10, if it mathes the requirement, then... (2 Replies)
Discussion started by: alfredo
2 Replies

4. Shell Programming and Scripting

How to pass a parameter

Hi all, How to pass a parameter from a oracle pl/sql procedure parameter to shell environment and use it? (1 Reply)
Discussion started by: megh
1 Replies

5. UNIX for Dummies Questions & Answers

How to pass parameter to subroutine

I have something like cp -p <dir>filename1.dat <dir2>filename1.dat there are many other operations in it I mean that filename1.dat will keep on changing I need to write a subroutine so that i can pass filename1 or 2 or 3 .dat as parameter Thanking you in advance Any help wuld be appreciated (2 Replies)
Discussion started by: ssuresh1999
2 Replies

6. Shell Programming and Scripting

How to pass a parameter from the terminal?

Hi, I am new in Ubuntu, I will be glud to know: 1. How to pass a parameter from the terminal to a file that I write in shell script. What is the command line I need to write in the terminal? 2. How to get the parameter in the file? What do I need to write in the file? 3. What kind of file is... (1 Reply)
Discussion started by: vess
1 Replies

7. Shell Programming and Scripting

How to pass two word parameter

Hi, How to pass parameter to run folloing script? #parameters are div, dept, style U run_convert_pdm.ksh Mens 44 7542 U run_convert_pdm.ksh "Mens Knit" 44 7541 The first command works fine but the second needs to have two words together , it does not work even if I have used double... (15 Replies)
Discussion started by: sandy162
15 Replies

8. Shell Programming and Scripting

pass parameter to SED

My script(ksh) works fine for --------------------------------------------------- sed -n '28,31p' ${l_name} >> ${LOG_DIR}/Email.txt --------------------------------------------------- But I wand to pass parrmeter to this syntax I did the following things ... (14 Replies)
Discussion started by: deep_kol
14 Replies

9. Shell Programming and Scripting

Pass parameter

Hi, I have following for loop , please let me know how to get ${TXP_EXT_TABLE_${i}_SQL} parameter with 1DAY and 7DAY values. for i in 1DAY 7DAY do ${NZSQL_DIR}/nzsql -h ${HOST} -time -v ON_ERROR_STOP=1 -f ${SQL_DIR}/${TXP_EXT_TABLE_${i}_SQL} > ${TMP_LOG_FILE} 2>&1 done ... (4 Replies)
Discussion started by: sandy162
4 Replies
TAP::Parser::Result::Test(3pm)				User Contributed Perl Documentation			    TAP::Parser::Result::Test(3pm)

NAME
TAP::Parser::Result::Test - Test result token. VERSION
Version 3.25 DESCRIPTION
This is a subclass of TAP::Parser::Result. A token of this class will be returned if a test line is encountered. 1..1 ok 1 - woo hooo! OVERRIDDEN METHODS
This class is the workhorse of the TAP::Parser system. Most TAP lines will be test lines and if "$result->is_test", then you have a bunch of methods at your disposal. Instance Methods "ok" my $ok = $result->ok; Returns the literal text of the "ok" or "not ok" status. "number" my $test_number = $result->number; Returns the number of the test, even if the original TAP output did not supply that number. "description" my $description = $result->description; Returns the description of the test, if any. This is the portion after the test number but before the directive. "directive" my $directive = $result->directive; Returns either "TODO" or "SKIP" if either directive was present for a test line. "explanation" my $explanation = $result->explanation; If a test had either a "TODO" or "SKIP" directive, this method will return the accompanying explanation, if present. not ok 17 - 'Pigs can fly' # TODO not enough acid For the above line, the explanation is not enough acid. "is_ok" if ( $result->is_ok ) { ... } Returns a boolean value indicating whether or not the test passed. Remember that for TODO tests, the test always passes. If the test is unplanned, this method will always return false. See "is_unplanned". "is_actual_ok" if ( $result->is_actual_ok ) { ... } Returns a boolean value indicating whether or not the test passed, regardless of its TODO status. "actual_passed" Deprecated. Please use "is_actual_ok" instead. "todo_passed" if ( $test->todo_passed ) { # test unexpectedly succeeded } If this is a TODO test and an 'ok' line, this method returns true. Otherwise, it will always return false (regardless of passing status on non-todo tests). This is used to track which tests unexpectedly succeeded. "todo_failed" # deprecated in favor of 'todo_passed'. This method was horribly misnamed. This was a badly misnamed method. It indicates which TODO tests unexpectedly succeeded. Will now issue a warning and call "todo_passed". "has_skip" if ( $result->has_skip ) { ... } Returns a boolean value indicating whether or not this test has a SKIP directive. "has_todo" if ( $result->has_todo ) { ... } Returns a boolean value indicating whether or not this test has a TODO directive. "as_string" print $result->as_string; This method prints the test as a string. It will probably be similar, but not necessarily identical, to the original test line. Directives are capitalized, some whitespace may be trimmed and a test number will be added if it was not present in the original line. If you need the original text of the test line, use the "raw" method. "is_unplanned" if ( $test->is_unplanned ) { ... } $test->is_unplanned(1); If a test number is greater than the number of planned tests, this method will return true. Unplanned tests will always return false for "is_ok", regardless of whether or not the test "has_todo". Note that if tests have a trailing plan, it is not possible to set this property for unplanned tests as we do not know it's unplanned until the plan is reached: print <<'END'; ok 1 ok 2 1..1 END perl v5.14.2 2012-06-05 TAP::Parser::Result::Test(3pm)
All times are GMT -4. The time now is 02:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy