![]() |
|
|
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 |
| Iteration through the results from a unix command | deviprasad83 | Shell Programming and Scripting | 4 | 06-12-2008 05:04 AM |
| joining command results, and substitution | ncatdesigner | Shell Programming and Scripting | 6 | 04-17-2008 12:37 PM |
| Setting the Results of a Command to a Variable | stky13 | UNIX for Dummies Questions & Answers | 1 | 02-29-2008 03:00 PM |
| My ps -ef|grep command results are chopped off | bsp18974 | UNIX for Dummies Questions & Answers | 1 | 08-14-2007 11:35 AM |
| How to output the results of the AT command - properly! | SpanishPassion | UNIX for Dummies Questions & Answers | 4 | 12-04-2005 10:27 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Results of command execution into array
Hi
Can anybody tell me how can I dump the results of execution of a command into array form? For example, I want to execute: Quote:
Quote:
|
|
||||
|
If your system supports process substitution:
Code:
IFS='\ ' read -d'^Y' -a array < <(fdisk -l | grep 83 | grep Linux) Last edited by Annihilannic; 08-19-2008 at 01:00 AM.. Reason: process substitution, not named pipes |
|
||||
|
If it doesn't support process substitution. Try this:
Code:
fdisk -l | grep 83 | grep Linux > /tmp/tempfile IFS='\ ' read -d'^Y' -a array < /tmp/tempfile Last edited by Annihilannic; 08-19-2008 at 01:00 AM.. Reason: process substitution, not named pipes |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|