![]() |
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 |
| Storing a variable? | hoover90 | Shell Programming and Scripting | 4 | 01-26-2008 09:39 PM |
| Problem storing SSH result in a variable | prash184u | Shell Programming and Scripting | 1 | 01-17-2008 04:41 PM |
| assign subst|grep|sed command result to a variable | snowbiker99 | Shell Programming and Scripting | 5 | 11-14-2007 07:08 PM |
| storing output of awk in variable | mab_arif16 | Shell Programming and Scripting | 3 | 05-07-2006 06:15 PM |
| Setting a variable to result of FIND command | JP Favara | Windows & DOS: Issues & Discussions | 2 | 03-09-2005 10:17 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
storing result of a command in variable
For whatever reason I cant seem to fix my syntax to do the following. I want to run a grep and count how many instances come up and store that number in a variable but I keep erroring out. Here's my code in bash:
Code:
number=grep blah file.txt | wc -l |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|