Sponsored Content
Top Forums Shell Programming and Scripting ash busybox read command not working inside function.... Post 302690805 by Corona688 on Thursday 23rd of August 2012 11:32:59 AM
Old 08-23-2012
ash does not support the read -t BASH extension.

ash does not support the read -p BASH extension.

ash does not support functions.

You need to rewrite your script without these things if you want it to run in ash.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

read command (input) inside the while loop

Hi, 'read' command is not working inside the while loop, How can I solve this? Rgds, Sharif. (2 Replies)
Discussion started by: sharif
2 Replies

2. Shell Programming and Scripting

sudo command is not working inside a script when placed in cron

Hi All, i have a cron entry like 0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /amex/sssmonitor/dss_chk.ksh and the script is like #!/bin/ksh file=`uname -n` > /sunmast/projects/oasis/COREDEV/Dss$file.log > /tmp/output_sss today=`date` varb=`ps -ef | grep... (5 Replies)
Discussion started by: usha rao
5 Replies

3. Shell Programming and Scripting

read statement not working in a function

Pls this is emergency.I have written a script which is taking input from another script. and the contents of my second script are acting as functions to my main script.Now the problem is that in one of the functions i want the script ececution to stop and start when user enters any character r... (2 Replies)
Discussion started by: sumitdua
2 Replies

4. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi hc.sh "hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

5. Web Development

CGI not working with httpd server on busybox 1.15.0 on ltib Linux 2.6.34 (404 page not found)

I have some industrial ARM linux board with 2.6.34 Linux on it with Busybox v1.15.0. The https.conf is located in /etc/ and contains: H:/root/web In the www directory I also have 'cgi-bin' folder with chmod 777 and in that folder a file called 'testcgi'. Now I start the server with... (1 Reply)
Discussion started by: Roboserg
1 Replies

6. Shell Programming and Scripting

Bash Script to Ash (busybox) - Beginner

Hi All, I have a script that I wrote on a bash shell, I use it to sort files from a directory into various other directories. I have an variable set, which is an array of strings, I then check each file against the array and if it is in there the script sorts it into the correct folder. But... (5 Replies)
Discussion started by: sgtbobie
5 Replies

7. Shell Programming and Scripting

If loop inside function not working.

check_deplver () { dir=/abc/def/ghi if ssh -o StrictHostKeychecking=no $1 "" 2> /dev/null then echo " output is " ssh -o StrictHostKeychecking=no $1 "ls -lrt $dir | grep -i abc" 2> /dev/null else echo " directory not presnt" fi } This is not working. But... (7 Replies)
Discussion started by: NarayanaPrakash
7 Replies

8. Shell Programming and Scripting

Getopts inside a function is not working

Hi All, I am using geopts inside a function in shell script. But it is doesnt seem to read the input args and I always gt empty value in o/p. my code is http://sparshmail.ad.infosys.com/owa/14.2.318.4/themes/base/pgrs-sm.gif This message has not been sent. #!/bin/ksh IFS=' '... (1 Reply)
Discussion started by: prasperl
1 Replies

9. Shell Programming and Scripting

Simple grep is not working properly on busybox

Hi, I'm trying to write shell scripts on busybox bash on windows and grep is not working for simple regular expression like $ grep FEN * bash: grep: Invalid argument but the same grep works fine if use the single file instead of asterisk $ grep FEN test $ Am I doing something... (5 Replies)
Discussion started by: prvnrk
5 Replies

10. Shell Programming and Scripting

This function (decode64) runs on gawk but not on busybox awk

Hello, I'm trying to figure out a way to use a decode64 function in an embedded system who has few utilities, including busybox. Right now have something like this (taken from "google base64-and-base85-encoding-awk-scripts" sorry, I'm not able to post urls yet) _decode64() { &&... (4 Replies)
Discussion started by: chilicuil
4 Replies
Parse::Method::Signatures(3)				User Contributed Perl Documentation			      Parse::Method::Signatures(3)

NAME
Parse::Method::Signatures - Perl6 like method signature parser DESCRIPTION
Inspired by Perl6::Signature but streamlined to just support the subset deemed useful for TryCatch and MooseX::Method::Signatures. TODO
o Document the parameter return types. o Probably lots of other things METHODS
There are only two public methods to this module, both of which should be called as class methods. Both methods accept either a single (non-ref) scalar as the value for the "input" attribute, or normal new style arguments (hash or hash-ref). signature my $sig = Parse::Method::Signatures->signature( '(Str $foo)' ) Attempts to parse the (bracketed) method signature. Returns a value or croaks on error. param my $param = Parse::Method::Signatures->param( 'Str $foo where { length($_) < 10 }') Attempts to parse the specification for a single parameter. Returns value or croaks on error. ATTRIBUTES
All the attributes on this class are read-only. input Type: Str The string to parse. offset Type: Int Offset into "input" at which to start parsing. Useful for using with Devel::Declare linestring signature_class Default: Parse::Method::Signatures::Sig Type: Str (loaded on demand class name) param_class Default: Parse::Method::Signatures::Param Type: Str (loaded on demand class name) type_constraint_class Default: Parse::Method::Signatures::TypeConstraint Type: Str (loaded on demand class name) Class that is used to turn the parsed type constraint into an actual Moose::Meta::TypeConstraint object. from_namespace Type: ClassName Let this module know which package it is parsing signatures form. This is entirely optional, and the only effect is has is on parsing type constraints. If this attribute is set it is passed to "type_constraint_class" which can use it to introspect the package (commonly for MooseX::Types exported types). See "find_registered_constraint" in Parse::Method::Signature::TypeConstraints for more details. type_constraint_callback Type: CodeRef Passed to the constructor of "type_constraint_class". Default implementation of this callback asks Moose for a type constrain matching the name passed in. If you have more complex requirements, such as parsing types created by MooseX::Types then you will want a callback similar to this: # my $target_package defined elsewhere. my $tc_cb = sub { my ($pms_tc, $name) = @_; my $code = $target_package->can($name); $code ? eval { $code->() } : $pms_tc->find_registered_constraint($name); } Note that the above example is better provided by providing the "from_namespace" attribute. CAVEATS
Like Perl6::Signature, the parsing of certain constructs is currently only a 'best effort' - specifically default values and where code blocks might not successfully for certain complex cases. Patches/Failing tests welcome. Additionally, default value specifications are not evaluated which means that no such lexical or similar errors will not be produced by this module. Constant folding will also not be performed. There are certain constructs that are simply too much hassle to avoid when the work around is simple. Currently the only cases that are known to parse wrong are when using anonymous variables (i.e. just sigils) in unpacked arrays. Take the following example: method foo (ArrayRef [$, $], $some_value_we_care_about) { In this case the $] is treated as one of perl's magic variables (specifically, the patch level of the Perl interpreter) rather than a "$" followed by a "]" as was almost certainly intended. The work around for this is simple: introduce a space between the characters: method foo (ArrayRef [ $, $ ], $some_value_we_care_about) { The same applies AUTHOR
Ash Berlin <ash@cpan.org>. Thanks to Florian Ragwitz <rafl@debian.org>. Many thanks to Piers Cawley to showing me the way to refactor my spaghetti code into something more manageable. SEE ALSO
Devel::Declare which is used by most modules that use this (currently by all modules known to the author.) <http://github.com/ashb/trycatch/tree>. LICENSE
Licensed under the same terms as Perl itself. This distribution copyright 2008-2009, Ash Berlin <ash@cpan.org> perl v5.18.2 2014-01-12 Parse::Method::Signatures(3)
All times are GMT -4. The time now is 12:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy