|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | 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. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have to cut a string using a multiple character delimiter.
I use -d'XP_' -f2 But delimiter is invalid ???? ( I have tried -d 'XP_' or -d"XP_" or -d "XP_" . Same error Any idea, someone to help. |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Hi ,
cut -f 2 -d XP_ normally it takes the second field and put "XP_" as separator this is what you want ? Christian |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
seems not working
a=TEXT_TEXT_XP_4.3.2A ( I'd like to extract 4.3.2A )
I'm typing : echo $a |cut -f2 -d XP_ and error is cut:invalid delimiter |
|
#4
|
||||
|
||||
|
I've become
cut: the delimiter must be a single character (GNU cut 5.3.0) Try sed or something like it |
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
$ echo TEXT_TEXT_XP_4.3.2A | sed -e 's/^.*XP_//'
|
| Sponsored Links | |
|
|
#6
|
||||
|
||||
|
From cut manual:
Quote:
Code:
echo "TEXT_TEXT_XP_4.3.2A" | cut -d_ -f4 |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| passing command output from one command to the next command in cshell | kaaliakahn | UNIX for Dummies Questions & Answers | 2 | 02-10-2012 04:59 PM |
| unix command : how to insert text at the cursor location via command line? | xib.be | UNIX for Advanced & Expert Users | 0 | 12-22-2010 05:45 PM |
| Need help! command working ok when executed in command line, but fails when run inside a script! | 4dirk1 | Shell Programming and Scripting | 4 | 12-02-2010 05:47 AM |
| awk command in script gives error while same awk command at prompt runs fine: Why? | catalys | Shell Programming and Scripting | 4 | 09-20-2010 10:07 PM |
| awk/sed Command : Parse parameter file / send the lines to the ksh export command | rajan_san | Shell Programming and Scripting | 4 | 11-06-2008 12:29 PM |
|
|