bash arrays

From: Amadeus (nobody_at_nowhere.org)
Date: 04/30/04


Date: Fri, 30 Apr 2004 13:11:04 -0400

Is there a way to extract a contiguous subarray of an array in bash?

I want to write a bash script which takes several arguments.
The first argument is mandatory, and is processed separately.
The rest of the arguments are file names which will be processed
in a loop.

So I need to extract the range 2-$# in $@. Can it be done?
Something like the : operator in matlab.

Thanks!



Relevant Pages

  • Re: Using perl in a Bash-script to extract IP-addresses?
    ... I need to extract those IPs & ranges, ... I've read that Perl is "best" for Text ... assign the comma-separated list to a variable in that Bash script. ...
    (perl.beginners)
  • Re: read maill batch commandline extracting body
    ... > commandline mode to read mails in a mbox-format ... > mail file an extract the body of each mail into a file. ... > Anybody used an mua in that way? ... messages with a simple bash script, or simply write a script to ...
    (comp.os.linux.misc)
  • Re: bash arrays
    ... > Is there a way to extract a contiguous subarray of an array in bash? ... > I want to write a bash script which takes several arguments. ...
    (comp.os.linux.misc)
  • Addition within bash script
    ... How do I go about adding, within a bash script, numbers grepped from a log? ... I'm using the following to extract connect times from syslog: ... How can the output digits be added together?. ...
    (comp.os.linux.misc)
  • Re: how to return mulitple corresponding values
    ... This will extract the dates in ascending order, oldest to newest, that meet ... I'm leaving out the sheet name so be sure to add it to your formula. ... Array entered**: ... If you're not using dynamic named ranges then I would "dummy down" ...
    (microsoft.public.excel.worksheet.functions)