Sponsored Content
Top Forums Shell Programming and Scripting Bash script pass sentence in block Post 302166213 by katrvu on Monday 11th of February 2008 10:04:18 AM
Old 02-11-2008
~THANK YOU VERY MUCH~Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script to ask for a sentence and then count number of spaces in the sentence

Hi People, I need some Help to write a unix script that asks for a sentence to be typed out then with the sentence. Counts the number of spaces within the sentence and then echo's out "The Number Of Spaces In The Sentence is 4" as a example Thanks Danielle (12 Replies)
Discussion started by: charlie101208
12 Replies

2. Shell Programming and Scripting

How to pass value from plsql script to unix bash?

Hi This is my bash script.i am calling validation.sql and passing a value to it using ${flds}. i want the cnt variable in plsql script to be passed to unix. LOADREC=`sqlplus -s $ORACLE_USR <<-EOF spool $ORACLE_LOG_FILE; echo "barani" @validation.sql #calling the plsql script ${flds}... (6 Replies)
Discussion started by: barani75
6 Replies

3. Shell Programming and Scripting

I have to pass a sentence in a file,

I have to pass a sentence in a file, the specs are as: cat run | sed 's/SRT/'$8'/g' | sed 's/plength/68/g' | sed 's/stcol/'$5'/g' | sed 's/encol/'$6'/g' | sed 's/brdtype/'$1'/g' | sed's/brdtxt/'$3'/g' | sed 's/demotxt/Total '$2'/g' | sed 's/bantxt/ban_'$7'/g' | sed 's/validcodes/'$4'/g' > runx ... (1 Reply)
Discussion started by: patilrakesh1984
1 Replies

4. Shell Programming and Scripting

want to pass sentence with SED and CAT

I have to pass a sentence in a file, the specs are as: cat run | sed 's/SRT/'$8'/g' | sed 's/plength/68/g' | sed 's/stcol/'$5'/g' | sed 's/encol/'$6'/g' | sed 's/brdtype/'$1'/g' | sed 's/brdtxt/'$3'/g' | sed 's/demotxt/Total '$2'/g' | sed 's/bantxt/ban_'$7'/g' | sed 's/validcodes/'$4'/g' > runx... (1 Reply)
Discussion started by: patilrakesh1984
1 Replies

5. Shell Programming and Scripting

How to Pass filename to AWK in bash script

I have written a script which works fine, to remove patterns contained in EXCLUDE.DAT from input.txt awk 'BEGIN {n=0;while (getline < "EXCLUDE.DAT" > 0){ex=$0;n++}} {for(var in ex){print var "-" ex $0 ;i++}}' input.txt The last problem I need to solve is how to pass the file... (3 Replies)
Discussion started by: nixie
3 Replies

6. Shell Programming and Scripting

Pass arguments to bash script

myscript.sh #!/bin/bash ARGA=$1 if ; then echo "${ARGA}:Confirmed" else echo "${ARGA}:Unconfirmed" fi when I run the above script from the command line, i run it as: ./myscript.sh jsmith now some times, i need to runn it this way: (8 Replies)
Discussion started by: SkySmart
8 Replies

7. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies

8. Shell Programming and Scripting

Curl , download file with user:pass in bash script

Hello, My question is about curl command. (ubuntu14.04) In terminal, I am able to download my mainfile with: curl -u user1:pass1 http://11.22.33.44/******* When I convert it into bash script like this: #!/bin/bash cd /root/scripts computer_ip=11.22.33.44 curl -u $1:$2... (8 Replies)
Discussion started by: baris35
8 Replies

9. UNIX for Beginners Questions & Answers

Pass RegEx to java program in bash script

I can't seem to get this right. I've tried it every way imaginable using every trick I see on stackexchange and such. No luck. So nothing major here, something like: #!/bin/bash SEARCH="ARG1 ARG2 '((^EXACT$)|(.*InTheMiddle*)|(^AtBeginning*))'" java -cp /my/class/path MyClassName $SEARCH... (3 Replies)
Discussion started by: stonkers
3 Replies

10. UNIX for Beginners Questions & Answers

Pass config file to bash script

I just want to make sure I am understanding how to pass a config file to a bash script . In the below I pass to arguments to a script, then define them in the script as id and config. I then source config using ., if I understand correctly the variables in the config file can now be used by the... (11 Replies)
Discussion started by: cmccabe
11 Replies
Test::NoWarnings(3)					User Contributed Perl Documentation				       Test::NoWarnings(3)

NAME
Test::NoWarnings - Make sure you didn't emit any warnings while testing SYNOPSIS
For scripts that have no plan use Test::NoWarnings; that's it, you don't need to do anything else For scripts that look like use Test::More tests => x; change to use Test::More tests => x + 1; use Test::NoWarnings; DESCRIPTION
In general, your tests shouldn't produce warnings. This modules causes any warnings to be captured and stored. It automatically adds an extra test that will run when your script ends to check that there were no warnings. If there were any warings, the test will give a "not ok" and diagnostics of where, when and what the warning was, including a stack trace of what was going on when the it occurred. If some of your tests are supposed to produce warnings then you should be capturing and checking them with Test::Warn, that way Test::NoWarnings will not see them and so not complain. The test is run by an "END" block in Test::NoWarnings. It will not be run when any forked children exit. USAGE
Simply by using the module, you automatically get an extra test at the end of your script that checks that no warnings were emitted. So just stick use Test::NoWarnings; at the top of your script and continue as normal. If you want more control you can invoke the test manually at any time with "had_no_warnings". The warnings your test has generated so far are stored in an array. You can look inside and clear this whenever you want with "warnings()" and "clear_warnings", however, if you are doing this sort of thing then you probably want to use Test::Warn in combination with Test::NoWarnings. use vs require You will almost always want to do use Test::NoWarnings If you do a "require" rather than a "use", then there will be no automatic test at the end of your script. Output If warning is captured during your test then the details will output as part of the diagnostics. You will get: o the number and name of the test that was executed just before the warning (if no test had been executed these will be 0 and '') o the message passed to "warn", o a full dump of the stack when warn was called, courtesy of the "Carp" module By default, all warning messages will be emitted in one block at the end of your test script. The :early pragma One common complaint from people using Test::NoWarnings is that all of the warnings are emitted in one go at the end. While this is the safest and most correct time to emit these diagnostics, it can make debugging these warnings difficult. As of Test::NoWarnings 1.04 you can provide an experimental ":early" pragma when loading the module to force warnings to be thrown via diag at the time that they actually occur. use Test::NoWarnings ':early'; As this will cause the diag to be emitted against the previous test and not the one in which the warning actually occurred it is recommended that the pragma be turned on only for debugging and left off when not needed. FUNCTIONS
had_no_warnings This checks that there have been warnings emitted by your test scripts. Usually you will not call this explicitly as it is called automatically when your script finishes. clear_warnings This will clear the array of warnings that have been captured. If the array is empty then a call to "had_no_warnings()" will produce a pass result. warnings This will return the array of warnings captured so far. Each element of this array is an object containing information about the warning. The following methods are available on these object. o $warn->getMessage Get the message that would been printed by the warning. o $warn->getCarp Get a stack trace of what was going on when the warning happened, this stack trace is just a string generated by the Carp module. o $warn->getTrace Get a stack trace object generated by the Devel::StackTrace module. This will return undef if Devel::StackTrace is not installed. o $warn->getTest Get the number of the test that executed before the warning was emitted. o $warn->getTestName Get the name of the test that executed before the warning was emitted. PITFALLS
When counting your tests for the plan, don't forget to include the test that runs automatically when your script ends. SUPPORT
Bugs should be reported via the CPAN bug tracker at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-NoWarnings> For other issues, contact the author. HISTORY
This was previously known as Test::Warn::None SEE ALSO
Test::Builder, Test::Warn AUTHORS
Fergal Daly <fergal@esatclear.ie> Adam Kennedy <adamk@cpan.org> COPYRIGHT
Copyright 2003 - 2007 Fergal Daly. Some parts copyright 2010 - 2011 Adam Kennedy. This program is free software and comes with no warranty. It is distributed under the LGPL license See the file LGPL included in this distribution or http://www.fsf.org/licenses/licenses.html. perl v5.16.3 2011-12-01 Test::NoWarnings(3)
All times are GMT -4. The time now is 04:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy