Sponsored Content
Full Discussion: geting the real path
Top Forums Shell Programming and Scripting geting the real path Post 302257777 by chebarbudo on Thursday 13th of November 2008 04:26:30 AM
Old 11-13-2008
MySQL geting the real path

Hi there,
Is there any way to obtain a real path from a weird path. For example :
Code:
/foo/../bar/    ->  /bar/
/foo/.          ->  /foo/

Thanks in advance
Santiago

Last edited by chebarbudo; 02-11-2009 at 04:11 AM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

geting server name(ipaddress)

hi, can any one say how to get the server name if we know the ipaddress ie nslookup gives ipaddress if server name is given in the same way can i have server name if i know ipaddress thanks & regards babu :o (1 Reply)
Discussion started by: babu@shell
1 Replies

2. Solaris

I am geting error while trying to stop managed server of WEB LOGIC

Dear All, I am geting error while trying to stop managed server of WEB LOGIC through the command stop_wls managed1_wlsdom02.Can anyone tell me why I am geting this error?managed1_wlsdom02.pid exists at the path mentioned. Do you need any other details?... (0 Replies)
Discussion started by: ASHISH MISHRA
0 Replies

3. Shell Programming and Scripting

geting user input from php and using perl for execution

I am using festival speech synthesis system and I would like to allow user input in a browser. This will be taken by a php page which is then supposed to pass the input text to a perl script. The perl script should pass this text to the festival engine by executing a unix command. this in turn... (2 Replies)
Discussion started by: wairimus
2 Replies

4. UNIX for Advanced & Expert Users

Getting real path to directory

Hi friends, Need your help. The question is: 1) We have directory '/SomeDirectory/SubDirectory' 2) And have symlink pointing to it like '/AnotherOneDirectory/symlink' '/AnotherOneDirectory/symlink' -> '/SomeDirectory/SubDirectory' 3) Need to get real path without symlinks knowing only... (7 Replies)
Discussion started by: kandrewo
7 Replies

5. Shell Programming and Scripting

geting a value out of awk script

the value of flag is reset inside the awk statments and is not getting echoed out of it. how can this be done?? #!/bin/ksh flag=0 awk -F '' '$2 == "ABCD" && $6 == "MNOP"{flag=1}' file.xml echo $flag I am always getting the value of flag as "0" , even after the $2 is "ABCD" and $6 is... (2 Replies)
Discussion started by: skyineyes
2 Replies

6. AIX

Geting a value dynamically from topas

Hi all, I got an idea to get a value (like Syscall or %comp details for example)dynamically from topas. Is there any way to do this. I guss there must be some door opened for this. I tried running topas and redirecting to a file but in vain. The idea is, script should run topas in... (4 Replies)
Discussion started by: jayadeava
4 Replies

7. UNIX for Advanced & Expert Users

Kernel Modules Not geting built

I installed in VM the Mandriva Linux with 2.6.27 kernel. But presently when I fire make the modules .ko does not get built. I get the following output on firing command in the kernel module folder. $ make Building first_driver.c ... make: Entering directory... (1 Reply)
Discussion started by: rupeshkp728
1 Replies

8. Shell Programming and Scripting

Not able to find the perfect code...Geting confused in between

I have to find last delimiter in each line of a file and store the value after the last '/' in a variable in ksh script...Pls Pls help me:(The file is as shown below: /opt/apps/cobqa/apps/abadv/bind/advc0007.bnd /opt/apps/cobqa/apps/abbrio/bind/naac6115.bnd... (5 Replies)
Discussion started by: bhavanabahety
5 Replies

9. UNIX for Dummies Questions & Answers

How to get real path to a file?

Hello, I need download a mp3 file from a site but I can not find the actual link. Thanks. Source codes <span title="what is" class="read"><embed type="application/x-shockwave-flash" src="au/audio.swf" width="17" height="13" align="texttop" quality="high" loop="false" menu="false"... (1 Reply)
Discussion started by: tara123
1 Replies
UNSET(3)								 1								  UNSET(3)

unset - Unset a given variable

SYNOPSIS
void unset (mixed $var, [mixed $...]) DESCRIPTION
unset(3) destroys the specified variables. The behavior of unset(3) inside of a function can vary depending on what type of variable you are attempting to destroy. If a globalized variable is unset(3) inside of a function, only the local variable is destroyed. The variable in the calling environment will retain the same value as before unset(3) was called. <?php function destroy_foo() { global $foo; unset($foo); } $foo = 'bar'; destroy_foo(); echo $foo; ?> The above example will output: bar To unset(3) a global variable inside of a function, then use the $GLOBALS array to do so: <?php function foo() { unset($GLOBALS['bar']); } $bar = "something"; foo(); ?> If a variable that is PASSED BY REFERENCE is unset(3) inside of a function, only the local variable is destroyed. The variable in the calling environment will retain the same value as before unset(3) was called. <?php function foo(&$bar) { unset($bar); $bar = "blah"; } $bar = 'something'; echo "$bar "; foo($bar); echo "$bar "; ?> The above example will output: something something If a static variable is unset(3) inside of a function, unset(3) destroys the variable only in the context of the rest of a function. Fol- lowing calls will restore the previous value of a variable. <?php function foo() { static $bar; $bar++; echo "Before unset: $bar, "; unset($bar); $bar = 23; echo "after unset: $bar "; } foo(); foo(); foo(); ?> The above example will output: Before unset: 1, after unset: 23 Before unset: 2, after unset: 23 Before unset: 3, after unset: 23 PARAMETERS
o $var - The variable to be unset. o $... - Another variable ... RETURN VALUES
No value is returned. EXAMPLES
Example #1 unset(3) example <?php // destroy a single variable unset($foo); // destroy a single element of an array unset($bar['quux']); // destroy more than one variable unset($foo1, $foo2, $foo3); ?> Example #2 Using (unset) casting (unset) casting is often confused with the unset(3) function. (unset) casting serves only as a NULL-type cast, for completeness. It does not alter the variable it's casting. <?php $name = 'Felipe'; var_dump((unset) $name); var_dump($name); ?> The above example will output: NULL string(6) "Felipe" NOTES
Note Because this is a language construct and not a function, it cannot be called using variable functions. Note It is possible to unset even object properties visible in current context. Note It is not possible to unset $this inside an object method since PHP 5. Note When using unset(3) on inaccessible object properties, the __unset() overloading method will be called, if declared. SEE ALSO
isset(3), empty(3), __unset(), array_splice(3). PHP Documentation Group UNSET(3)
All times are GMT -4. The time now is 07:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy