Hi All,
I need a small help.. when we use aliased commands in shell script, they are not being recognized when I used. Is there any way to use aliased commands in scritping? Please let me know if u know...
Thank you
Chanu (19 Replies)
Hi everyone,
I am trying to create a simple batch file to make SQL backups. this part of it works fine. Currently the script can mysql dump the databases, compress them, delete the .sql, compress the individual tar.gz into one larger one, delete the smaller files, encrypt the final tar.gz and... (1 Reply)
Hey folks,
I'm pretty new to unix programming. I was trying to get something to work but it's not doing what I expected.
#!/bin/ksh
. ./functions.sh
STRING=function_1
FUNCTION="$STRING"
RETURN=eval $FUNCTION
echo "value of $FUNCTION function is: $RETURN"
All i'm... (5 Replies)
Hi Friends,
I'm calling 'sed' command inside one perl script, which is to list directory names which are having some date value as their names (in the form YYYYMMDD) with in the range (start and end date).
#!/usr/bin/perl -w
use strict;
use warnings;
my $DATA = "/export/home/ganapa";
my... (5 Replies)
echo "$previous_tmp$i"
I have a 5 variables like
previous1
previous2
previous3
previous4
previous5
I want to use a for loop to call them one by one.
How can I ?:confused: (2 Replies)
First post on here. So I use csh shells for my research (physics... not a CS person). I am trying to rerun the same scripts, but there are ~10 files that have similar variables that I have to change for each different configuration, so I would like one central file for the variables I change that... (3 Replies)
Hi everyone,
Is it possible to set a variable that calls another variable?
I.E.
SCRIPT=MY_SCRIPT.ksh ${VAR5}
${VAR5} is set earlier in the script, and I want to be able to call this when setting the ${SCRIPT} variable.
I hope this makes sense.
Thanks for your help. (3 Replies)
Hi all,
I have a source config file with variables like so:
eth1_ip=192.168.1.99
eth2_ip=192.168.1.123
eth3_ip=172.16.1.1
I am trying to run a script which loops based on the number of eth interfaces on a machine and therefore modifies the variable it calls in the environment based on the... (5 Replies)
Hi All,
I have file which have looks like below
abc=${def}
def=${efg}
efg= "this is the actual value"
based on "abc" value I have to call "efg" value , Am using below lines but it is not working
#!/bin/bash
source file.txt
echo $abc
Please wrap all code, files, input &... (5 Replies)
I'm trying to do something like this:
find . -name blablabla -exec ln -s ./"{:53:14} blablabla" \;
The idea is find blablabla and create a symbolic link to it using part of it's path and then it's name, "blablabla."
I just don't know if I can call characters out of a find variable. ... (16 Replies)
Discussion started by: scribling
16 Replies
LEARN ABOUT DEBIAN
devel::lexalias
LexAlias(3pm) User Contributed Perl Documentation LexAlias(3pm)NAME
Devel::LexAlias - alias lexical variables
SYNOPSIS
use Devel::LexAlias qw(lexalias);
sub steal_my_x {
my $foo = 1;
lexalias(1, '$x', $foo);
}
sub foo {
my $x = 22;
print $x; # prints 22
steal_my_x;
print $x; # prints 1
}
DESCRIPTION
Devel::LexAlias provides the ability to alias a lexical variable in a subroutines scope to one of your choosing.
If you don't know why you'd want to do this, I'd suggest that you skip this module. If you think you have a use for it, I'd insist on it.
Still here?
lexalias( $where, $name, $variable )
$where refers to the subroutine in which to alias the lexical, it can be a coderef or a call level such that you'd give to "caller"
$name is the name of the lexical within that subroutine
$variable is a reference to the variable to install at that location
BUGS
lexalias delves into the internals of the interpreter to perform its actions and is so very sensitive to bad data, which will likely result
in flaming death, or a core dump. Consider this a warning.
There is no checking that you are attaching a suitable variable back into the pad as implied by the name of the variable, so it is possible
to do the following:
lexalias( $sub, '$foo', [qw(an array)] );
The behaviour of this is untested, I imagine badness is very close on the horizon though.
SEE ALSO
peek_sub from PadWalker, Devel::Peek
AUTHOR
Richard Clamp <richardc@unixbeard.net> with close reference to PadWalker by Robin Houston
COPYRIGHT
Copyright (c) 2002, Richard Clamp. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under
the same terms as Perl itself.
perl v5.14.2 2002-07-25 LexAlias(3pm)