![]() |
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 |
| 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| after grep i want to redirect it to some variable | mail2sant | Shell Programming and Scripting | 2 | 04-07-2008 09:26 AM |
| awk redirect output to shell variable | dhinge | Shell Programming and Scripting | 3 | 12-09-2006 12:11 PM |
| Redirect Output In Variable | ZINGARO | UNIX for Dummies Questions & Answers | 1 | 08-02-2006 06:56 AM |
| redirect command output to variable | hugow | UNIX for Dummies Questions & Answers | 1 | 06-22-2005 06:43 AM |
| please help: how to redirect input into a variable | artur80 | Shell Programming and Scripting | 2 | 11-17-2002 10:18 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Redirect to variable
how do you redirect stdout into a variable. whenever I try I get an ambiguous redirect error
I am trying to validate some user input and failing miserably.cal $MONTH $YEAR | grep -c "$DAY" if the above is 1 then it is valid if 0 then not valid. I have been trying to redirect the output into a variable but get the error. Any ideas? Many Thanks. |
|
||||
|
Backtick operator
Try:
X=`cal $month $year |grep -c $day` The ` character is usually the lower case of the ~ character, and is located just to the left of the '1' or above the tab key on most keyboards. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|