Sponsored Content
Full Discussion: Inputs argument for sh -c
Top Forums Shell Programming and Scripting Inputs argument for sh -c Post 303009426 by Corona688 on Thursday 14th of December 2017 10:15:21 AM
Old 12-14-2017
No, they're not. I don't think that code ever worked.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Multiple Inputs

Have tried the search, but nothing resembles what I'd like to accomplish. I am attempting to write a script that will allow the user to input a list of data at the command prompt, then the data is used by another script for processing. I am allowing the user a list of 10 members in order to... (4 Replies)
Discussion started by: douknownam
4 Replies

2. Shell Programming and Scripting

Inputs from a file

Hi, I have a shell script that has to taken inputs from a file say "Inputs". Now I take 2 inputs at a time. Suppose the Inputs file contains numbers like 2 3 4 5 Now I have a written a script for adding 2 numbers. When I run the script for first time 2 and 3 must be the inputs. When i run the... (4 Replies)
Discussion started by: sendhil
4 Replies

3. Shell Programming and Scripting

Please give your inputs !!!!

I am trying to extract two fields from the output of ifconfig command on one of my sun server . The output looks like : root@e08k18:/tmp/test# ifconfig -a lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 ce0:... (9 Replies)
Discussion started by: kpatel786
9 Replies

4. UNIX for Dummies Questions & Answers

How to find the last argument in a argument line?

How to find the last argument in a argument line? (4 Replies)
Discussion started by: nehagupta2008
4 Replies

5. Shell Programming and Scripting

passing argument to shell script that reads user inputs

Hi, Lets say I have a script "ss" which does this read abc echo $abc read pqr echo $pqr Now if I want to pass and argument to only "abc" how do I do it. If I do echo "somevalue" | ss, it does not prompt for pqr and its value comes out as blank. Any help is appreciated Thanks P (6 Replies)
Discussion started by: patjones
6 Replies

6. Shell Programming and Scripting

get positive number n as argument script must calculate the factorial of its argument

Can someone please help me with this SHELL script? I need to create a script that gets a positive number n as an argument. The script must calculate the factorial of its argument. In other words, it must calculate n!=1x2x3x...xn. Note that 0!=1. Here is a start but I have no clue how to... (3 Replies)
Discussion started by: I-1
3 Replies

7. Shell Programming and Scripting

Cannot compare argument in if statement in csh/grep command if argument starts with “-“

If ($argv == “-debug”) then Echo “in loop” Endif But this is not working. If I modify this code and remove “-“, then it works. Similarly I am getting problem using grep command also Grep “-debug” Filename Can someone please help me on how to resolve these... (1 Reply)
Discussion started by: sarbjit
1 Replies

8. Shell Programming and Scripting

Make script that run with argument if not run from configuration file argument

Hello, Is there any method thorugh which script can take argument if pass otherwise if argument doesn't pass then it takes the argument from the configuration file i.e I am workiing on a script which will run through crontab and the script will chekout the code ,zip and copy to the... (3 Replies)
Discussion started by: rohit22hamirpur
3 Replies

9. UNIX for Advanced & Expert Users

Error:--test: argument expected--Even though i give an argument.

Hi All, I am running the script VBoxManage list vms |sed 's/"//g' | cut -d " " -f1 > har1out.mytxt result=`cat har1out.mytxt | grep $1' echo $result echo $1 { if then echo pass else echo fail fi (2 Replies)
Discussion started by: harsha85
2 Replies

10. Shell Programming and Scripting

Read variable inputs

I am trying to make an interactive script. Only problem my inputs are not read and correctly channeled. Please help: Here is my code #!/bin/sh PATHSCRIPT=/home/pp/tmp #if ; then # echo "Syntax : $0 input off lat sample" # exit 1 # fi echo "Choice of Graph" echo "1 -- Type... (5 Replies)
Discussion started by: newkid.7955
5 Replies
Return::Value(3pm)					User Contributed Perl Documentation					Return::Value(3pm)

NAME
Return::Value - (deprecated) polymorphic return values VERSION
version 1.666001 DO NOT USE THIS LIBRARY
This library will begin issuing deprecation warnings in June 2010. Return::Value was a bad idea. i'm sorry that I had it, sorry that I followed through, and sorry that it got used in other useful libraries. Fortunately there are not many things using it. One of those things is Email::Send which is also deprecated in favor of Email::Sender. There's no reason to specify a new module to replace Return::Value. In general, routines should return values of uniform type or throw exceptions. Return::Value tried to be a uniform type for all routines, but has so much weird behavior that it ends up being confusing and not very Perl-like. Objects that are false are just a dreadful idea in almost every circumstance, especially when the object has useful properties. Please do not use this library. You will just regret it later. SYNOPSIS
Used with basic function-call interface: use Return::Value; sub send_over_network { my ($net, $send) = @_: if ( $net->transport( $send ) ) { return success; } else { return failure "Was not able to transport info."; } } my $result = $net->send_over_network( "Data" ); # boolean unless ( $result ) { # string print $result; } Or, build your Return::Value as an object: sub build_up_return { my $return = failure; if ( ! foo() ) { $return->string("Can't foo!"); return $return; } if ( ! bar() ) { $return->string("Can't bar"); $return->prop(failures => @bars); return $return; } # we're okay if we made it this far. $return++; return $return; # success! } DESCRIPTION
Polymorphic return values are a horrible idea, but this library was written based on the notion that they were useful. Often, we just want to know if something worked or not. Other times, we'd like to know what the error text was. Still others, we may want to know what the error code was, and what the error properties were. We don't want to handle objects or data structures for every single return value, but we do want to check error conditions in our code because that's what good programmers do. When functions are successful they may return true, or perhaps some useful data. In the quest to provide consistent return values, this gets confusing between complex, informational errors and successful return values. This module provides these features with a simplistic API that should get you what you're looking for in each context a return value is used in. Attributes All return values have a set of attributes that package up the information returned. All attributes can be accessed or changed via methods of the same name, unless otherwise noted. Many can also be accessed via overloaded operations on the object, as noted below. type A value's type is either "success" or "failure" and (obviously) reflects whether the value is returning success or failure. errno The errno attribute stores the error number of the return value. For success-type results, it is by default undefined. For other results, it defaults to 1. string The value's string attribute is a simple message describing the value. data The data attribute stores a reference to a hash or array, and can be used as a simple way to return extra data. Data stored in the data attribute can be accessed by dereferencing the return value itself. (See below.) prop The most generic attribute of all, prop is a hashref that can be used to pass an arbitrary number of data structures, just like the data attribute. Unlike the data attribute, though, these structures must be retrived via method calls. FUNCTIONS
The functional interface is highly recommended for use within functions that are using "Return::Value" for return values. It's simple and straightforward, and builds the entire return value in one statement. success The "success" function returns a "Return::Value" with the type "success". Additional named parameters may be passed to set the returned object's attributes. The first, optional, parameter is the string attribute and does not need to be named. All other parameters must be passed by name. # simplest possible case return success; failure "failure" is identical to "success", but returns an object with the type "failure" METHODS
The object API is useful in code that is catching "Return::Value" objects. new my $return = Return::Value->new( type => 'failure', string => "YOU FAIL", prop => { failed_objects => @objects, }, ); Creates a new "Return::Value" object. Named parameters can be used to set the object's attributes. bool print "it worked" if $result->bool; Returns the result in boolean context: true for success, false for failure. prop printf "%s: %s', $result->string, join ' ', @{$result->prop('strings')} unless $result->bool; Returns the return value's properties. Accepts the name of a property retured, or returns the properties hash reference if given no name. other attribute accessors Simple accessors exist for the object's other attributes: "type", "errno", "string", and "data". Overloading Several operators are overloaded for "Return::Value" objects. They are listed here. Stringification print "$result "; Stringifies to the string attribute. Boolean print $result unless $result; Returns the "bool" representation. Numeric Also returns the "bool" value. Dereference Dereferencing the value as a hash or array will return the value of the data attribute, if it matches that type, or an empty reference otherwise. You can check "ref $result->data" to determine what kind of data (if any) was passed. TODO
Add deprecation. AUTHORS
Casey West, <casey@geeknest.com>. Ricardo Signes, <rjbs@cpan.org>. COPYRIGHT
Copyright (c) 2004-2006 Casey West and Ricardo SIGNES. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.0 2009-06-08 Return::Value(3pm)
All times are GMT -4. The time now is 12:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy