Before I even attempt this, is it possible to grep for a pattern, maybe a partial sentence like "go to page 3", assign that to a variable and then use awk or something to pull out the 3 and assign it to a variable? So first I would have
Gotopg = "go to page 3"
then
page = 3 (9 Replies)
I need to assign a variable within a variable in a sed command.
I tried doing the following in c shell.
set left = 1
set right = 2
set segment = qwerty
sed -n -e "/$segment{$left}/,/$segment{$right}/p" file.txt
what is wrong with this syntax? (3 Replies)
Hi,
Is there any way to assign defaults values to the shell variables without reassigning them ( restarting the session)
for example
after login the value of ORACLE_HOME=/a/b/c
i have changed this value from the console
export ORACLE_HOME=/c/d
now what if i want the value exported to... (1 Reply)
Hi GUYS,
I have function. I am assigning a line count to count variable. But it is throwing an error at this line.
function_recur (){
#file being created in this function
lenth = `wc -l function_outpu.dat`;
echo $lenth;
}
this is the error i got
rec.ksh: lenth: not found.
... (3 Replies)
Hi,
I am having a line which is separated by -
I need to extract each field and put into some variable.
a=`echo "this-is-the-case" | awk -F- '{print $1}' `
b=`echo "this-is-the-case" | awk -F- '{print $2}' `
c=`echo "this-is-the-case" | awk -F- '{print $3}' `
d=`echo "this-is-the-case" | awk... (2 Replies)
Hi All,
I have a tcsh script as:
#!/usr/bin/csh -x
set packsName=$(awk -F'' '/^execute.*=true/{print $2}' ExecutePacks.config)
for var in $packsName
do
echo "printed $var"
done
I want to assign the value which is returned by awk function to the variable called packsName.
How do I... (2 Replies)
Hi Gurus,
I have a file named log with 2 lines
Each line is a file name. eg
$ cat log
monday
tuesday
I need to read log and assign each output(filename) to a different variable.
The following doesn't work:-
while read A B
do
echo " a is ${A} "
echo " b is ${B} "
done <... (6 Replies)
Hi! This might be a simple thing, but I'm struggling to assign values to variables from the file.
I've the following values stored in the file.. It consists of only two rows..
10
20
I want to assign the first row value to variable "n1" and the second row value to variable "n2"..
That is ... (3 Replies)
i have variables RECIPIENTS_DEVL,RECIPIENTS_UACC,RECIPIENTS_PROD
i have a case statement to get the phase variable:
case ${WMD_UPHASE1} in
u) WMD_UPHASE4=UACC;;
i) WMD_UPHASE4=DEVL;;
p) WMD_UPHASE4=PROD;;
d) WMD_UPHASE4=DEVL;;
*) WMD_UPHASE4=DEVL;;
esac
I am unable to... (3 Replies)
Discussion started by: Arun Mishra
3 Replies
LEARN ABOUT DEBIAN
perl6::export
Export(3pm) User Contributed Perl Documentation Export(3pm)NAME
Perl6::Export - Implements the Perl 6 'is export(...)' trait
SYNOPSIS
# Perl 5 code...
package Some::Module;
use Perl6::Export;
# Export &foo by default, when explicitly requested,
# or when the ':ALL' export set is requested...
sub foo is export(:DEFAULT) {
print "phooo!";
}
# Export &var by default, when explicitly requested,
# or when the ':bees', ':pubs', or ':ALL' export set is requested...
# the parens after 'is export' are like the parens of a qw(...)
sub bar is export(:DEFAULT :bees :pubs) {
print "baaa!";
}
# Export &baz when explicitly requested
# or when the ':bees' or ':ALL' export set is requested...
sub baz is export(:bees) {
print "baassss!";
}
# Always export &qux
# (no matter what else is explicitly or implicitly requested)
sub qux is export(:MANDATORY) {
print "quuuuuuuuux!";
}
sub import {
# This subroutine is called when the module is used (as usual),
# but it is called after any export requests have been handled.
# Those requests will have been stripped from its argument list
}
DESCRIPTION
Implements what I hope the Perl 6 symbol export mechanism might look like.
It's very straightforward:
o If you want a subroutine to be capable of being exported (when explicitly requested in the "use" arguments), you mark it with the "is
export" trait.
o If you want a subroutine to be automatically exported when the module is used (without specific overriding arguments), you mark it with
the "is export(:DEFAULT)" trait.
o If you want a subroutine to be automatically exported when the module is used (even if the user specifies overriding arguments), you
mark it with the "is export(:MANDATORY)" trait.
o If the subroutine should also be exported when particular export groups are requested, you add the names of those export groups to the
trait's argument list.
That's it.
WARNING
The syntax and semantics of Perl 6 is still being finalized and consequently is at any time subject to change. That means the same caveat
applies to this module.
DEPENDENCIES
Requires Filter::Simple
AUTHOR
Damian Conway (damian@conway.org)
BUGS AND IRRITATIONS
Does not yet handle the export of variables.
Comments, suggestions, and patches welcome.
COPYRIGHT
Copyright (c) 2003, Damian Conway. 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.8.8 2008-03-12 Export(3pm)