![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| get characters from output of a command in a variable | muaz | Shell Programming and Scripting | 3 | 06-02-2008 06:13 AM |
| Variable Manimpulation - special characters | Nomaad | Shell Programming and Scripting | 1 | 04-04-2008 02:17 PM |
| Accessing invidual characters in a variable name | suman_jakkula | Shell Programming and Scripting | 2 | 07-31-2006 09:23 AM |
| Replacing set of characters with a value of a variable | prekida | Shell Programming and Scripting | 1 | 07-26-2005 05:14 PM |
| awk substr and variable for next n characters? | smacleod | UNIX for Dummies Questions & Answers | 1 | 04-16-2002 11:05 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi ,
I need to get the specified word from the variable.can some one help me out in this ? input=ASD34567P i need to get the value as : output1=34567 So i need to ignore the last character and get the remaining values. THANKS IN ADVANCE. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Quote:
34567 vs ASD34567 |
|
#3
|
|||
|
|||
|
Sorry i need to drop first three characters 34567.... and the last character also...
|
|
#4
|
||||
|
||||
|
Is it always the first 3 characters and the last or you want the alphabets alone to be dropped ?
|
|
#5
|
|||
|
|||
|
yes Vino ....i need to drop the first three characters and the last character. it is afixed format so .. i need to get that number.
|
|
#6
|
||||
|
||||
|
Quote:
Code:
output1=$(echo $input | sed -e "s/^...\(.*\).$/\1/g") |
|
#7
|
|||
|
|||
|
Thanks vino....It working fine.I am not awware of sed can u please explain what this command will do?
|
|||
| Google The UNIX and Linux Forums |