![]() |
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 |
| Need to get pid of a process and have to store the pid in a variable | samudha | UNIX for Dummies Questions & Answers | 7 | 08-05-2008 03:24 AM |
| How to store the sql query's output in a variable | venkatesh_sasi | Shell Programming and Scripting | 4 | 01-18-2008 01:03 AM |
| store the first line of a file in a variable | dineshr85 | Shell Programming and Scripting | 0 | 12-06-2007 04:41 AM |
| To store the output in a variable | Sudhakar333 | Shell Programming and Scripting | 2 | 07-10-2007 08:45 AM |
| store awk results in a variable | forever_49ers | Shell Programming and Scripting | 1 | 09-19-2006 10:51 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to Store command O/P to a variable...
Hi all..
I got a problem.. Its easy to redirect o/p to a file.. But Is it possible to redirect the O/P to a variable? For example: I've a command in my script: Code:
string1=cut -d ':' -f2 file.txt Code:
echo $string1 |
|
||||
|
Quote:
syntax error at line 5: '(' unexpected |
|
||||
|
Quote:
#!/bin/ksh str1=`cut -d":" -f2 file.txt echo $str1 This will work i hope. Thanks Namish |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|