hi all
i'm writing a script and in it i need to prompt the user if the entered value is correct or not ,i wrote the following and its not working ,its executing the script even if i enter Y/N
pls any help is appreciated
echo "\nAre you sure you entered the right Destination Environment? y :... (5 Replies)
I want to write a program with the following variables:
a=7000
b=24000
c=613.8
The user can enter two words: Vivid or Blue for example. The challenge is that the user might not want to write the words the way they appear. The user can write V or v or vivid or Vivid or write Blue or blue, or B,... (1 Reply)
I am writing a script to pull diskspace information from our servers. Here is the script that I wrote:
#!/bin/ksh
for host in `cat /oper/hosts/esc.misc`
do
ssh -q -o ConnectTimeout=10 operator@$host df -h|grep "/dev/" |egrep '8%|9%|100%' | awk '{print H " " "at " $5 " with " $4 "... (1 Reply)
Hi,
I'm trying to write a routine to parse a file that contains data that will be read
into arrays. The file is composed of labels to identify data types and arbitrary
lines of data with the usual remarks and empty new lines as is common with
config files.
The initial pass is built as so:... (3 Replies)
I'm pretty sure I already know the answer to this, but I want to make sure I'm not overlooking anything. I'm working on a log monitoring script and every 10 lines I want to display a summary of events. The thing is, there are a lot of possible events, that likely won't have happened, so I only want... (0 Replies)
I have the following bash script and it is not accepting the lines
"--"|"--""-")
"--""-"")
while
do
echo "Current Argument is ${1}"
case "$1" in
"--"|"--""-")
echo "Argument is ${1}"
shift # Skip ahead one to the next argument.
... (1 Reply)
Hello All,
I am writing a script that is to be placed on multiple servers, and of course I've started
running into some compatibility issues for certain shell commands.
The code below worked just fine on most of my machines except for a couple.
Here I had 4 separate lines in my script that... (3 Replies)
Hi I am new to shell scripting, I wanted to make a shell script that has a case statement asking the user to select their city 1)london 2)tokyo 3) etc., I then want the users input to be stored in a variable and echoed out in another script; so for example if the user selects tokyo, tokyo city code... (2 Replies)
Hi Gurus,
I have the below BASH code which does not works for upper case alphabets except Z (upper case Z).
What may be the reason. Also escape sequences like \n, \t, \b, \033(1m \033(0m (For bold letter) are not working.
case $var in
)
echo "Lower case alphabet"
;;
... (7 Replies)
I'm having an issue with bash read input when using a case statement.
The script halts and doesn't read the input on the first loop. if I hit enter then the scripts starts to respond as expected. Need some help here.
defaultans=8hrs
read -e -i $defaultans -p "${bldwht}How long would you like... (5 Replies)
Discussion started by: woodson2
5 Replies
LEARN ABOUT REDHAT
symbol
Symbol(3pm) Perl Programmers Reference Guide Symbol(3pm)NAME
Symbol - manipulate Perl symbols and their names
SYNOPSIS
use Symbol;
$sym = gensym;
open($sym, "filename");
$_ = <$sym>;
# etc.
ungensym $sym; # no effect
# replace *FOO{IO} handle but not $FOO, %FOO, etc.
*FOO = geniosym;
print qualify("x"), "
"; # "Test::x"
print qualify("x", "FOO"), "
" # "FOO::x"
print qualify("BAR::x"), "
"; # "BAR::x"
print qualify("BAR::x", "FOO"), "
"; # "BAR::x"
print qualify("STDOUT", "FOO"), "
"; # "main::STDOUT" (global)
print qualify(*x), "
"; # returns *x
print qualify(*x, "FOO"), "
"; # returns *x
use strict refs;
print { qualify_to_ref $fh } "foo!
";
$ref = qualify_to_ref $name, $pkg;
use Symbol qw(delete_package);
delete_package('Foo::Bar');
print "deleted
" unless exists $Foo::{'Bar::'};
DESCRIPTION
"Symbol::gensym" creates an anonymous glob and returns a reference to it. Such a glob reference can be used as a file or directory handle.
For backward compatibility with older implementations that didn't support anonymous globs, "Symbol::ungensym" is also provided. But it
doesn't do anything.
"Symbol::geniosym" creates an anonymous IO handle. This can be assigned into an existing glob without affecting the non-IO portions of the
glob.
"Symbol::qualify" turns unqualified symbol names into qualified variable names (e.g. "myvar" -> "MyPackage::myvar"). If it is given a sec-
ond parameter, "qualify" uses it as the default package; otherwise, it uses the package of its caller. Regardless, global variable names
(e.g. "STDOUT", "ENV", "SIG") are always qualified with "main::".
Qualification applies only to symbol names (strings). References are left unchanged under the assumption that they are glob references,
which are qualified by their nature.
"Symbol::qualify_to_ref" is just like "Symbol::qualify" except that it returns a glob ref rather than a symbol name, so you can use the
result even if "use strict 'refs'" is in effect.
"Symbol::delete_package" wipes out a whole package namespace. Note this routine is not exported by default--you may want to import it
explicitly.
perl v5.8.0 2002-06-01 Symbol(3pm)