PDA

View Full Version : [SOLVED] cd into the $DISPLAY directory



sportfreak2020
April 13th, 2010, 06:19 PM
Hey everybody

i was wondering if we could cd in the directory of the PATH variable

for example, if i type in echo $DISPLAY

it will give me /tmp/launch-3ee4fg/org.x:0

is there any way that i can just take the value '/tmp/launch-3ee4fg/' from the output of $DISPLAY and exclude out the filename to the end of the command

i tried using the read command and the IFS variable..apparently IFS does not recognise / i guess

but any help is greatly appreciated... :P

cdenley
April 13th, 2010, 07:19 PM
How about this?


dirname $DISPLAY

sportfreak2020
April 13th, 2010, 08:16 PM
GOT IT!!
You are awesome..thank you sir..