Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove wrong for syntax #97

Merged
merged 1 commit into from
Dec 29, 2023
Merged

remove wrong for syntax #97

merged 1 commit into from
Dec 29, 2023

Conversation

shuaitq
Copy link
Contributor

@shuaitq shuaitq commented May 25, 2023

as bash document show

for syntax only have two types

for name [ [in [words …] ] ; ] do commands; done

and

for (( expr1 ; expr2 ; expr3 )) ; do commands ; done

the for syntax show below is wrong and should be deleted

for x := 1 to 10 do
begin
  statements
end

test

on my Mac

bash-3.2$ bash --version
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin22)
Copyright (C) 2007 Free Software Foundation, Inc.
bash-3.2$ cat test.sh 
#!/bin/bash

for x := 1 to 10 do
begin
  echo $x
end
bash-3.2$ ./test.sh 
./test.sh: line 3: syntax error near unexpected token `:='
./test.sh: line 3: `for x := 1 to 10 do'

@Idnan
Copy link
Owner

Idnan commented Dec 29, 2023

Thank you.

@Idnan Idnan merged commit 98d5a3d into Idnan:master Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants