Bash execution error in pipeline template

This is a trivial question, but it seems that I am not able to figure out what is happening.

I am trying to execute a bash script from the pipeline, but I get the following error:
{message:404 File Not Found}: command not found

This is how the .yml looks like:

assembly:
  stage: build
  environment:
    name: ...
  script:
    - ....
    - curl -o test.sh ...
    - chmod 777 test.sh
    - more test.sh
    - type bash
    - ./test.sh

And the result in the log:

$ curl -o test.sh ...
Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 32 100 32 0 0 147 0 --:--:-- --:--:-- --:--:-- 147

$ chmod 777 test.sh

$ type bash
bash is /usr/bin/bash

$ more test.sh
::::::::::::::
test.sh
::::::::::::::

{"message":"404 File Not Found"}$ ./test.sh
./test.sh: line 1: {message:404 File Not Found}: command not found

test.sh:

#!/bin/bash

echo "hello"

Q1)
Why the bash script execution does not work?
The bash file is there, it does not contain any special command.

Maybe the bash context that is provided by GitLab is not correct?

Q2)
Why the more command does not show the correct file content?

This script section in the pipeline file is executed in a strange way.
What I missed?

Hi,

look strange. Which image are you using to execute the jobs? The 404 message looks like the error message from curl, which gets directed into test.sh from the streamed download. What happens if you run curl without the -o parameter?

Regarding more - this prints to stdout and waits for user input, which is not available in a runner execution context.

Cheers,
Michael

You were right. The 404 message comes from the curl command. I need to use the -o param because without it the filename on the disk will be not correct.

Anyway, after the curl command was fixed the 404 message dissapeared.

Thx for the help.