Sponsored Content
Full Discussion: problem with I/O script
Top Forums Shell Programming and Scripting problem with I/O script Post 302158835 by cleansing_flame on Wednesday 16th of January 2008 11:02:34 AM
Old 01-16-2008
Quote:
Originally Posted by Perderabo
But it got rid of the error message you complained about, right? You didn't say it wanted it to work. Smilie In that case...

while [ "$1" -ne " " ]

without the quotes, and if $1 is blank, the shell will just see...
while [ -ne " " ]
which doesn't make sense. (Actually, I missed this at first glance.)
this is weird, it still doesn't work
i'm trying to take input and redirect output into a file, so -ne may not work but since variables are strings, i'm not really sure

here is the sttderr
line 6: [: : integer expression expected
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Problem starting a script from a 'main'-script

Please Help! :o I have a main script (ksh) where another script is called (convert_picture). Normally this works ok, but since some changes has been made on the unix-server (I dont know what :( ) suddenly it doesnt work anymore: i get an error message: ksh: convert_picture not found. I am... (3 Replies)
Discussion started by: Rakker
3 Replies

2. Shell Programming and Scripting

Help. Script problem

hey guys. i have a bunch of programs in a script that needs to run as root and the rest as another user, we'll call him gabriel. now, in this script, i want to run the first few lines as root. now, how do i, after running as root, tell the script to run the remaining lines as the user gabriel?... (3 Replies)
Discussion started by: Terrible
3 Replies

3. Shell Programming and Scripting

ssh script problem problem

Hi Please help me with the following problem with my script. The following block of code is not repeating in the while loop and exiting after searching for first message. input_file ========== host001-01 host001-02 2008-07-23 13:02:04,651 ConnectionFactory - Setting session state... (2 Replies)
Discussion started by: pcjandyala
2 Replies

4. Shell Programming and Scripting

call shell script from perl cgi script problem

hi,, i have perl scipt with line : system('./try.sh $t $d $m'); in shell scipt try.sh i have the line: echo $1 its not printing value of $t that i hav passed..y is it so..i am running it from apache web server (2 Replies)
Discussion started by: raksha.s
2 Replies

5. UNIX for Dummies Questions & Answers

Problem with script

Hello All. I have a script that is suppossed to start up a daemon but when executed, simply hangs. Could you please take a look and let me know where the problem might be? TIA ################################################################### # # SCRIPT: dstart3000.sh # Bring up the Domain... (6 Replies)
Discussion started by: grin1dan
6 Replies

6. Shell Programming and Scripting

Problem with a script

Hi everyone, I got a problem with a script. What it's supposed to do is: to take as arguments a directory name <dir> and a dimension (in byte) <dim>; if <dir> exists, to write name and dimension of every regular file within it that sizes lesser than <dim> in regFileList. Nothing happens... (10 Replies)
Discussion started by: Luke Bonham
10 Replies

7. Shell Programming and Scripting

Problem running a program/script in the background from a script

Hi all, I have a script that calls another program/script, xxx, to run in the background. Supposedly this program at most should finish within five (5) minutes so after five (5) minutes, I run some other steps to run the script into completion. My problem is sometimes the program takes... (5 Replies)
Discussion started by: newbie_01
5 Replies

8. Shell Programming and Scripting

Problem while calling a script within a script

Hi , I have moduled my scripts in three scripts . From First script i am calling second and from second i am calling third for some check . Problem is with the third script call. ---In second script EXP ='test.\abc.\Server.*abc.xml.*' pid=$($HOME/bin/checkpid $EXP) --Third... (2 Replies)
Discussion started by: amrishn
2 Replies

9. Shell Programming and Scripting

Shell script newbie, what is problem with my script?

Hello, Ubuntu server 11.10 can anybody help what is problem with my shell script? #!/bin/bash #script to find out currently logged on user is root or not. if ] then echo "You are super" else echo "You are awesome!" fi When I run script, I get following output ./uid: line 3: I... (4 Replies)
Discussion started by: kaustubh
4 Replies

10. Shell Programming and Scripting

Problem in calling a script inside a script

Hi team, I have a script in different folder. Now i want to call that script and execute that script from that path alone. My code is #!/bin/bash wname=yahoo PATH='/opt/IBM' wac=`/usr/bin/ls $PATH | /usr/bin/grep "$wname"` STOP=`/usr/bin/find $PATH/$wac -type f -name "stop.sh"`... (8 Replies)
Discussion started by: natraj005
8 Replies
UNIVERSAL::require(3)					User Contributed Perl Documentation				     UNIVERSAL::require(3)

NAME
UNIVERSAL::require - require() modules from a variable SYNOPSIS
# This only needs to be said once in your program. require UNIVERSAL::require; # Same as "require Some::Module" my $module = 'Some::Module'; $module->require or die $@; # Same as "use Some::Module" BEGIN { $module->use or die $@ } DESCRIPTION
If you've ever had to do this... eval "require $module"; to get around the bareword caveats on require(), this module is for you. It creates a universal require() class method that will work with every Perl module and its secure. So instead of doing some arcane eval() work, you can do this: $module->require; It doesn't save you much typing, but it'll make alot more sense to someone who's not a ninth level Perl acolyte. Methods require my $return_val = $module->require or die $@; my $return_val = $module->require($version) or die $@; This works exactly like Perl's require, except without the bareword restriction, and it doesn't die. Since require() is placed in the UNIVERSAL namespace, it will work on any module. You just have to use UNIVERSAL::require somewhere in your code. Should the module require fail, or not be a high enough $version, it will simply return false and not die. The error will be in $@ as well as $UNIVERSAL::require::ERROR. $module->require or die $@; use my $require_return = $module->use or die $@; my $require_return = $module->use(@imports) or die $@; Like "UNIVERSAL::require", this allows you to "use" a $module without having to eval to work around the bareword requirement. It returns the same as require. Should either the require or the import fail it will return false. The error will be in $@. If possible, call this inside a BEGIN block to emulate a normal "use" as closely as possible. BEGIN { $module->use } SECURITY NOTES
UNIVERSAL::require makes use of "eval STRING". In previous versions of UNIVERSAL::require it was discovered that one could craft a class name which would result in code being executed. This hole has been closed. The only variables now exposed to "eval STRING" are the caller's package, filename and line which are not tainted. UNIVERSAL::require is taint clean. COPYRIGHT
Copyright 2001, 2005 by Michael G Schwern <schwern@pobox.com>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html AUTHOR
Michael G Schwern <schwern@pobox.com> Now maintained by Neil Bowers (NEILB). SEE ALSO
Module::Load, "require" in perlfunc, <http://dev.perl.org/rfc/253.pod> perl v5.18.2 2013-09-27 UNIVERSAL::require(3)
All times are GMT -4. The time now is 08:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy