Resolve a Variable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Resolve a Variable
# 1  
Old 05-12-2005
Resolve a Variable

Hi

I have a variable which is a path ie:

UBERROR=/cobwrk/mchr/prodsup/ub/wrk/../error
is there anyway I can get the output of an echo to read:

#echo $UBERROR
/cobwrk/mchr/prodsup/ub/error
instead of
#echo $UBERROR
/cobwrk/mchr/prodsup/ub/wrk/../error

Many thanks!
# 2  
Old 05-12-2005
Code:
$ UBERROR=/cobwrk/mchr/prodsup/ub/wrk/../error
$ UBERROR=`echo "${UBERROR}" | sed 's!wrk/../!!'`
$ echo ${UBERROR}
/cobwrk/mchr/prodsup/ub/error

Cheers
ZB
# 3  
Old 05-12-2005
Cheers ZB

But I have a lot of these to resolve and didnt want to have to sed out each of them in turn....
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Could not resolve ip through DNS

Dear all , Very recently our DNS server ip got changed. I have entered the DNS ip in /etc/resolv.conf ...but I could not resolv it for my ip address. Verified that , the IP is added in the DNS also. It is still working with the old DNS ip. Please let me know what could be... (11 Replies)
Discussion started by: jegaraman
11 Replies

2. Shell Programming and Scripting

Cannot resolve $variable in awk

My script ---------- for i in `cat n`;do export k=`echo "CSN: "$i` //combining CSN: and value from n echo "$k" awk ''{print "CSN: "$0;}'{_=29}_&&_--' file1|tail -1 >> file2 done In the above script i cannot able to resolve $k in awk command file n contains ------------ 0000 1111 2222... (2 Replies)
Discussion started by: Mohana29_1988
2 Replies

3. Shell Programming and Scripting

Resolve parameter value stored in a variable

Hi All, I have below variable, xyz=\$AI_XFR Now, if you will run the below command => echo $xyz $AI_XFR It is returning hardcoded string value. Whereas in environment, there is value in it. Like below: => echo $AI_XFR /home/aditya/sandbox/xfr/ I need to resolve this... (4 Replies)
Discussion started by: adgangwar
4 Replies

4. Shell Programming and Scripting

Resolve variable inside another variable

Hello Everyone, I am trying to resolve a variable inside another variable.Let me go straight to the example. Input: Query=$Table_1 Join $Table_2 (Query itself is a variable here) Now for two different cases I am assigning different values to Table_1 and Table_2 Case 1:... (14 Replies)
Discussion started by: vinay4889
14 Replies

5. Shell Programming and Scripting

Resolve Environment Variable

I am tyring to resolve an environment variable that is part of a string I selected from our database. Simply put, I want cd to this folder before checking if a file exists. The variable $in_loc has the value '$PS_HOME/int/VSP' where $PS_HOME is the environment variable. I am using cd... (6 Replies)
Discussion started by: consult_jb
6 Replies

6. UNIX for Dummies Questions & Answers

Resolve IP to Hostname?

Good day, I would like to resolve IP's to Hostnames using Putty. I'm using Mandriva Linux 2008.0. Is this possible? Perhaps with nmap? (13 Replies)
Discussion started by: McGuywer
13 Replies

7. UNIX for Dummies Questions & Answers

Please resolve it

#!/bin/sh# 'clear'for i in $(seq -w 15 37)doecho $iecho The content in ZZ=`wget --dns-timeout=0.001 http://napdweb${i}.eao.abn-iad.ea.co.../test/test.jsp`echo $ZA="Connection timed out."echo The content in Aecho $Aexpr "$A" : '..\(...\)'echo $Adone Hi,Please see the above program. The above... (9 Replies)
Discussion started by: veerumahanthi41
9 Replies

8. Shell Programming and Scripting

please resolve the below problem

#!/bin/sh # 'clear' for i in $(seq -w 15 37) do echo $i echo The content in Z Z=`wget --dns-timeout=0.001 http://napdweb${i}.eao.abn-iad.ea.com:8000/webcore/test/test.jsp` echo $Z A="Connection timed out." echo The content in A echo $A expr "$A" : '..\(...\)' echo $A done ... (1 Reply)
Discussion started by: veerumahanthi41
1 Replies

9. UNIX for Dummies Questions & Answers

how do u resolve this????

Please help me on how to resolve: 1-unresponsive terminals 2-unresponsive applications 3-how to interrupt processe p.s unix/linux OS (1 Reply)
Discussion started by: zizu
1 Replies

10. IP Networking

Cannot Resolve Host Name

I am running LexMark MarkNetPro-3 print servers on my AIX network. All of the sudden, none of my printers will print anymore. I am getting an error message on the console: Unable to resolve host name. This message comes up everytime a user submits a print job. Any Ideas? (1 Reply)
Discussion started by: Docboyeee
1 Replies
Login or Register to Ask a Question