![]() |
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 |
| Problem adding into an array field!!! | talk2pawee | Shell Programming and Scripting | 5 | 06-11-2009 02:39 AM |
| Extracting a field value from a line | Naresh Akkal | Shell Programming and Scripting | 5 | 05-06-2009 03:51 AM |
| Extracting Field values for XML file | junaid.nehvi | High Level Programming | 3 | 03-27-2009 12:38 PM |
| Perl - if conditions is meet, push the last field of $_ into an array | popeye | Shell Programming and Scripting | 1 | 12-10-2008 02:16 PM |
| extracting a field from directory path ?????? | skyineyes | Shell Programming and Scripting | 15 | 07-10-2007 12:42 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Extracting field from array
I have a problem with the following lines of code:
Code:
SaveIFS=$IFS
IFS="/"
declare -a Array=($1)#take unix path, split by '/'
website=${Array[4]} #stores website name
If the code is moved to another machine, I get empty string instead of website (the path is identical on both machines). |
|
||||
|
It appeared to be different shell versions. The was a bug in the older one. Upgrading the shell fixed it. Thanks!
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|