Process substitution command in . ebextensions - bash

I'm trying to install Netdata in my aws beanstalk instances. I created a config file in my .ebextensions folder
container_commands:
00install:
command: "bash <(curl -Ss https://my-netdata.io/kickstart.sh) --dont-wait"
ignoreErrors: true
When the command gets ran on deploy beanstalk logs this error.
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `bash <(curl -Ss https://my-netdata.io/kickstart.sh) --dont-wait'
I had no idea what <() meant so I looked it up and saw it was process substitution. From what I understood process substitution can be rewriting using plain pipes.
For example
more <( ls /usr/bin )
Could be
ls /usr/bin | more
In my command I'm also passing in flags so I was having issues gettin the piped version of the command working.
NOTE: The root problem is beanstalk telling me its confused about the parenthesis. My solution was just transforming the command to use regular pipes. However, if anyone knows just how I write this command on the beanstalk config to get it working that would be awesome.

Related

Script don't recognize strings (Docker Windows)

I have an exe file which executing some commands in docker container (ubuntu) that should make a build and run application. In some step I need to make a copy of dist file and command looks like this
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v //f/bigaboo/repos/ledger://f/bigaboo/repos/ledger --workdir=//f/bigaboo/repos/ledger bbcli_executor bash -c "cp ./public/index.php.dist ./public/index.php"
When I just run this command in the terminal all works well but if it's under exe control I have this output
./public/index.php.dist: -c: line 1: unexpected EOF while looking for matching `"'
./public/index.php.dist: -c: line 2: syntax error: unexpected end of file
2022/10/31 22:14:42 Failed to create index.php`. Error -> exit status 2
Looks like script don't recognize strings under exe.
I've tried to wrap cp in '',`` and \x22 but I've got the same result but with different symbols also I've tried to change encoding also without success :(

TensorFlow installation - pip

I am following this guide to install pip: https://www.tensorflow.org/install/pip
When I run this command: . ./venv/bin/activate.fish
I get the following error:
-bash: ./venv/bin/activate.fish: line 4: syntax error near unexpected token -d'
-bash: ./venv/bin/activate.fish: line 4:function deactivate -d "Exit virtualenv and return to normal shell environment"'
Please assist.
thanks
The script activate.fish is intended for fish shell. You're running bash so it's a wrong script for bash. With bash use activate:
. ./venv/bin/activate
The command should be
$ source ./venv/bin/activate
if you are using bash in a Linux machine.

Shell Script failing on alpine linux while working in mac terminal

The following line fails when run in a alpine docker container:
toDelete=( $(curl --silent $url/_cat/indices\?format=json | jq -r '.[].index | select(startswith('\".kibana\"'))') )
The following error message appears:
run.sh: line 1: syntax error: unexpected "("
When I run the command in the terminal on my mac, everything works properly. The brackets are added so that the result (variable toDelete) is interpreted as array and can be looped through with a for loop like so:
for index in "${toDelete[#]}"; do
curl -X DELETE $url/$index
done
Any help in how to solve this problem is appreciated!
Marking down the answer.
The issue was with the interpreter.
worked after making the below change.
["/bin/ash", "run.sh"]
the passed one was
["/bin/sh", "run.sh"]

bash: syntax error near unexpected token `newline'

I'm trying to test the supposed flaw in OS X Lion, of how unprotected the password is, on my own computer (from this article). But when I enter the code the in terminal that is supposed to extract the password hash:
$ dscl localhost -read /Search/Users/<root user>
I get this:
-bash: syntax error near unexpected token `newline'
is there any way to get around this?
When you see <xxx> in a command-line command, it typically means "substitute something here". For example,
$ ls <file>
doesn't mean to literally type in ls <file> in your Terminal, but to type in ls followed by some filename.
In this case, they want you to substitute the name of your root user for <root user>. For most machines, that is simply root.
In Azure bash shell in case your scenarios is this:
$ az webapp stop \
--resource-group learn-f69ca399-f99b-4950-84a6-bda8206c6ba0 \
--name <apiyoachola>
bash: syntax error near unexpected token `newline'
This should solve it
$ az webapp stop \
--resource-group learn-f69ca399-f99b-4950-84a6-bda8206c6ba0 \
--name apiyoachola

JSBuilder - trouble with command line build

I have a Sencha Touch application I am trying use JSBuilder to build which I am running this script in my Terminal:
bash JSBuilder.sh -v -p airside.jsb3 -d .\AirSide
But I am receiving this error:
JSBuilder.sh: line 11: ./jsdb/mac/jsdb: Permission denied
I am not sure how to fix this or what I am doing wrong?
Try putting sudo in front of the bash

Resources