Sponsored Content
Top Forums Shell Programming and Scripting assign var with set=a[5] not working Post 302480061 by novice_man on Tuesday 14th of December 2010 01:40:11 AM
Old 12-14-2010
Hi Rohon,

It doesn't work here.
Code:
$cat bp
asd/dad/a[5]

$ set a=`awk -F"\/" '{print $NF}' bp`
awk: warning: escape sequence `\/' treated as plain `/'

$ echo $a
echo: No match.

Thanks.

Last edited by Scott; 12-14-2010 at 03:14 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

assign value to variable is not working

Hi :) The next script campares two files File1-Line1 vs File2-Line1, File1-Line1 vs File2-Line2... only if line contains "AS-", if LineX is not in File2 writes in aux, but "valor" is allways=1 never changes! :confused: What is wrong? valor changes to 0 before break, after brake is again 1 ... (3 Replies)
Discussion started by: agustincm
3 Replies

2. Shell Programming and Scripting

Difference between "set $<var>" and "set -- $<var>"

Hi pros, Could anyone tell me the actual difference between setting the positional parameters from the variable using the following commands? $ var="This is my question" $ set $var $ echo $1 --> 'This' $ echo $2 --> 'is' .... .... and $ var="This is my question" $ set --... (3 Replies)
Discussion started by: royalibrahim
3 Replies

3. Shell Programming and Scripting

assign shell var output of cmd "wc"

how do I feed output of "wc" to a shell script variable "countBcp"? (2 Replies)
Discussion started by: devy
2 Replies

4. Shell Programming and Scripting

SSH script. (Assign $var to free cmd) ???

Running: GNU/Linux, 2.6.22.9-61.fc6 (hope that's the right info needed) I am trying give the amount of RAM and the % used. I am using free command. I am having some problems with this command code: 1)T = `free | grep Mem | awk '{print $2}'` F = `free | grep Mem | awk '{print $4}'`... (3 Replies)
Discussion started by: AngelFlesh
3 Replies

5. Shell Programming and Scripting

how to create variables in loop and assign filename after set command?

Hi, does anybody knows how to manage, that the filenames are assigned to a variable in a loop afer getting them with set command in a ksh, like: set B*.txt i=1 c=$# x=$((c+1)) echo "$x" while ] ; do _ftpfile$i="$"$i echo "$_ftpfile$i" i=$((i+1)) done The first echo returns,... (2 Replies)
Discussion started by: spidermike
2 Replies

6. UNIX for Advanced & Expert Users

assign array with a local var???

topic moved to programming (0 Replies)
Discussion started by: zing_foru
0 Replies

7. Programming

assign array with a local var???

Hi all, I am just wondering is this (below code) valid in programming int xx = 10110; int i; long yy = {1,2,3,4,5,6,7,8,xx}; I compiled this using gcc will all working option successfully without getting any warning or error. I didn't see this kind of code in my past... (7 Replies)
Discussion started by: zing_foru
7 Replies

8. Windows & DOS: Issues & Discussions

How to automatically set the DISPLAY var?

Hi all, Our users use Putty on Windows servers to log on to UNIX via SSH and run GUI applications. Is there a way to automatically get the display numbers from xming or Exceed (that are running on Windows) to set the DISPLAY var properly on UNIX? X11 forwarding is not an option. The closest I... (3 Replies)
Discussion started by: ejianu
3 Replies

9. Shell Programming and Scripting

Csh , how to set var value into new var, in short string concatenation

i try to find way to make string concatenation in csh ( sorry this is what i have ) so i found out i can't do : set string_buff = "" foreach line("`cat $source_dir/$f`") $string_buff = string_buff $line end how can i do string concatenation? (1 Reply)
Discussion started by: umen
1 Replies

10. UNIX for Beginners Questions & Answers

Using read to assign value to bash variable not working

Hi, I am attempting to assign the output of the following command, to two bash variables, var1 and var2 using "read," but it doesn't seem to be working. # openstack hypervisor stats show | awk -F'|' 'NR==14{print $2,$3}' vcpus 92 # echo $? 0 # openstack hypervisor... (4 Replies)
Discussion started by: sand1234
4 Replies
GET_PARENT_CLASS(3)							 1						       GET_PARENT_CLASS(3)

get_parent_class - Retrieves the parent class name for object or class

SYNOPSIS
string get_parent_class ([mixed $object]) DESCRIPTION
Retrieves the parent class name for object or class. PARAMETERS
o $object - The tested object or class name. This parameter is optional if called from the object's method. RETURN VALUES
Returns the name of the parent class of the class of which $object is an instance or the name. Note If the object does not have a parent or the class given does not exist FALSE will be returned. If called without parameter outside object, this function returns FALSE. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.1.0 | | | | | | | If called without parameter outside object, this | | | function would have returned NULL with a warning, | | | but now returns FALSE. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 Using get_parent_class(3) <?php class dad { function dad() { // implements some logic } } class child extends dad { function child() { echo "I'm " , get_parent_class($this) , "'s son "; } } class child2 extends dad { function child2() { echo "I'm " , get_parent_class('child2') , "'s son too "; } } $foo = new child(); $bar = new child2(); ?> The above example will output: I'm dad's son I'm dad's son too SEE ALSO
get_class(3), is_subclass_of(3). PHP Documentation Group GET_PARENT_CLASS(3)
All times are GMT -4. The time now is 04:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy