![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Removing double quotes in a file | kingofprussia | UNIX for Dummies Questions & Answers | 3 | 12-19-2008 05:28 AM |
| String concat that keeps quotes | duke | UNIX for Dummies Questions & Answers | 8 | 07-24-2008 06:48 AM |
| Add single quotes in string | mrjunsy | UNIX for Dummies Questions & Answers | 1 | 07-18-2008 10:09 AM |
| sed removing comma inside double quotes | joanneho | Shell Programming and Scripting | 2 | 06-30-2008 12:13 AM |
| problem with single quotes in a string and findbug | bob122480 | Shell Programming and Scripting | 9 | 01-19-2007 11:38 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Removing back quotes from string in CSH
Hello,
I am using csh to read a text file and save its words into variable $word in a foreach loop. These words have small back quotes ` as integral parts of them, for example, one word would be `abc`, another would be `xyz1` etc... These quotes are always the first and last characters of the variable $word. I need to remove these symbols and just keep abc or xyz1. I tried this code in my csh: set SortedID = $word set SortedID = `echo $word | cut -d '`' -f 2` Obviously it fails because of bad nested use of `, I should probably use an escape character in my '`', but changing it to '\`' did not work. In both cases, with or without the back slash, I get the error: Unmatched '. This same code does exactly what I want directly on the Linux shell, since I don't need the back cote to invoque it as I do from csh. Is there another escape character I can use? or maybe there is a different solution all together? Thanks Last edited by aplaydoc; 02-24-2009 at 05:39 PM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|