Skip to main content
Copyedited.
Source Link
dhag
  • 16.3k
  • 4
  • 57
  • 66

Array Arrays in unixUnix Bourne Shell

I am trying to implementuse arrays in Bourne shell (/bin/sh). I found that the way to initialize array elements is:

arr=(1 2 3)

But it is encountering an error:

syntax error at line 8: `arr=' unexpected

Now the post where I found this syntax says it is for bash, but I could not find any separate syntax for Bourne shell. Does the syntax stand the same for /bin/sh as well?

Array in unix Bourne Shell

I am trying to implement arrays in Bourne shell (/bin/sh). I found that the way to initialize array elements is:

arr=(1 2 3)

But it is encountering an error:

syntax error at line 8: `arr=' unexpected

Now the post where I found this syntax says it is for bash, but I could not find any separate syntax for Bourne shell. Does the syntax stand the same for /bin/sh as well?

Arrays in Unix Bourne Shell

I am trying to use arrays in Bourne shell (/bin/sh). I found that the way to initialize array elements is:

arr=(1 2 3)

But it is encountering an error:

syntax error at line 8: `arr=' unexpected

Now the post where I found this syntax says it is for bash, but I could not find any separate syntax for Bourne shell. Does the syntax stand the same for /bin/sh as well?

I am trying to implement arrayarrays in Bourne shell (/bin/sh/bin/sh). I found that the way to initialize array elements is:

arr=(1 2 3)

But it is encountering an error:

syntax error at line 8: `arr=' unexpected

Now the post where I found this syntax says it is for bash shellbash, but I could not find any separate syntax for Bourne shell. Does the syntax standsstand the same for /bin/sh as well?

I am trying to implement array in Bourne shell (/bin/sh). I found that way to initialize array elements is:

arr=(1 2 3)

But it is encountering an error:

syntax error at line 8: `arr=' unexpected

Now the post where I found this syntax says it is for bash shell, but I could not find any separate syntax for Bourne shell. Does the syntax stands the same for /bin/sh as well?

I am trying to implement arrays in Bourne shell (/bin/sh). I found that the way to initialize array elements is:

arr=(1 2 3)

But it is encountering an error:

syntax error at line 8: `arr=' unexpected

Now the post where I found this syntax says it is for bash, but I could not find any separate syntax for Bourne shell. Does the syntax stand the same for /bin/sh as well?

improved formatting and tags
Source Link
Mat
  • 54.9k
  • 11
  • 164
  • 143

I am trying to implement array in Bourne shell (/bin/sh). I found that way to initialize array elements is - arr=(1 2 3):

arr=(1 2 3)

But it is encountering an error - "syntax error at line 8: arr=' unexpected"`:

syntax error at line 8: `arr=' unexpected

Now the post where I found this syntax says it is for bash shell, but I could not find any separate syntax for bourneBourne shell. Does the syntax stands the same for "/bin/sh" as well?

I am trying to implement array in Bourne shell (/bin/sh). I found that way to initialize array elements is - arr=(1 2 3)

But it is encountering an error - "syntax error at line 8: arr=' unexpected"`

Now the post where I found this syntax says it is for bash shell, but I could not find any separate syntax for bourne shell. Does the syntax stands the same for "/bin/sh" as well?

I am trying to implement array in Bourne shell (/bin/sh). I found that way to initialize array elements is:

arr=(1 2 3)

But it is encountering an error:

syntax error at line 8: `arr=' unexpected

Now the post where I found this syntax says it is for bash shell, but I could not find any separate syntax for Bourne shell. Does the syntax stands the same for /bin/sh as well?

Source Link
SubhasisM
  • 533
  • 1
  • 4
  • 6
Loading