![]() |
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 |
| [csh] How to capture output from a command and pass it on to a variable? | machinogodzilla | Shell Programming and Scripting | 3 | 05-11-2008 09:36 AM |
| ls command output to variable in script | dsrookie | UNIX for Dummies Questions & Answers | 1 | 03-10-2008 04:14 PM |
| Assigning output of command to a variable | oma04 | Shell Programming and Scripting | 5 | 06-27-2006 12:11 PM |
| redirect command output to variable | hugow | UNIX for Dummies Questions & Answers | 1 | 06-22-2005 06:43 AM |
| Command output to a variable. | videsh77 | Shell Programming and Scripting | 8 | 12-16-2004 06:06 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
get characters from output of a command in a variable
Hi,
i have two questions, I am new to programming 1. I have an output of a command and i want to get some specific part of it in a variable. i am trying sr=`some comand xyz| grep 'Last Changed Rev:' | cut -c19-` now variable sr gets a end of line character at end. output of the command is Date: yyyy-mm-dd --------- abc xyz Last Changed Rev: 10 abc ------------- i want to get this 10 in the variable sr. i dont know the number length in advance. 2. Also the comand returns multiple lines output, how to get complete text in between abc xyz Last Changed Rev: 10 abc in another variable? please help! Thanks in advance.. Last edited by muaz; 06-02-2008 at 08:18 AM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|