List directories in localhost using lftp cmd - bash

I'm trying to copy a file to a folder in localhost using lftp command but I'm having troubles executing commands.
When I try to list folders in a directory using : !dir;
I get the following error : stderr: 1. bash.exe: warning: could not find /tmp, please create! 2. sh: -c: line 0: syntax error near unexpected token ;;' 3. sh: -c: line 0: dir;;

Related

Starting expo project failed: ps and grep commands not found

I tried running my expo project for the first time on a new M1 Pro mac. I obtained the following error logs. For context, I am using the fish shell. What is wrong? Are ps and grep obtained through some package(s)?
bananas#MacBook-Pro ~/E/myproject [254]> expo start
WARNING: expo-cli has not yet been tested against Node.js v17.0.1.
If you encounter any issues, please report them to https://github.com/expo/expo-cli/issues
expo-cli supports following Node.js versions:
* >=12.13.0 <13.0.0 (Maintenance LTS)
* >=14.0.0 <15.0.0 (Active LTS)
* >=15.0.0 <17.0.0 (Current Release)
Starting project at /Users/williama/Experiments/prpool
Developer tools running on http://localhost:19002
Opening developer tools in the browser...
/bin/sh: ps: command not found
/bin/sh: grep: command not found
/bin/sh: ps: command not found
/bin/sh: grep: command not found
/bin/sh: ps: command not found
/bin/sh: grep: command not found
/bin/sh: ps: command not found
/bin/sh: grep: command not found
/bin/sh: ps: command not found
/bin/sh: grep: command not found
/bin/sh: ps: command not found
/bin/sh: grep: command not found
Error: spawn open ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:475:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
I did not have my PATH set up properly.
Before, I had
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin"
export PATH=$ANDROID_HOME/platform-tools
I realized that the last line was overwriting my PATH variable and throwing away everything set on the first line, since the I was not using the $PATH reference (notice the dollar sign) on the second definition.
export PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin"

Process substitution command in . ebextensions

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.

Bash script errors with setting into variable to be executed script paths

I have the following script:
https://gist.github.com/pc-magas/37ec5e668c12017eb32aa308a0cb8f35
And on the execution I have these error messages:
./scripts/install2.sh: line 84: /home/pcmagas/Kwdikas/Docker/ellakcy/scripts/../start.sh: Permission denied
./scripts/install2.sh: line 87: /home/pcmagas/Kwdikas/Docker/ellakcy/scripts/../stop.sh: Permission denied
./scripts/install2.sh: line 89: ${STARTUP_SCRIPT_PATH}: ambiguous redirect
chmod: missing operand after 'u+x'
Try 'chmod --help' for more information.
Startup script generated
./scripts/install2.sh: line 94: ${STOP_SCRIPT_PATH}: ambiguous redirect
chmod: missing operand after 'u+x'
Try 'chmod --help' for more information.
The source of the errors are these lines of script:
touch "${SCRIPT_PATH}/start.sh"
STARTUP_SCRIPT_PATH= "${SCRIPT_PATH}/start.sh"
touch "${SCRIPT_PATH}/stop.sh"
STOP_SCRIPT_PATH= "${SCRIPT_PATH}/stop.sh"
What I want/try to do is my script by given some parameters to auto-generate scripts in order to start and stop some docker container services.
But somehow the plan backfires to me right now.
May I have some help please.
You need sudo to get permission to write the script files, and there were spaces between the variable name and value; there must not be any spaces around the = signs:
sudo touch "${SCRIPT_PATH}/start.sh"
STARTUP_SCRIPT_PATH="${SCRIPT_PATH}/start.sh" # Note no spaces ..PATH="${..
sudo touch "${SCRIPT_PATH}/stop.sh"
STOP_SCRIPT_PATH="${SCRIPT_PATH}/stop.sh" # Again here.

Cannot Install Meteor on command line Mac OSX

I'm trying to install Meteor on my Mac, following the instructions on their site (https://www.meteor.com/install)
curl https://install.meteor.com/ | sh
However, when I run the command, I get the following error:
sh: line 1: syntax error near unexpected token `newline'
sh: line 1: `<!DOCTYPE html>'
Pretty new to Terminal, so pointers appreciated.

Confusing Error message when using Brew

Every time when I run a brew command, it will give me several error lines at the beginning. I can't understand what's going on here. Can anyone tell me how I can get rid of the error?
brew
/bin/sh: __rvm_ruby_string_find: line 8: syntax error near unexpected token `('
/bin/sh: __rvm_ruby_string_find: line 8: ` ruby-+([1-9]) | ruby-+([1-9]).+([0-9]) | ruby-1.+([1-9]).+([0-9]) | jruby-[19]*)'
/bin/sh: error importing function definition for `__rvm_ruby_string_find'
/bin/sh: __rvm_project_ruby_env_load_parse_file: line 9: syntax error near unexpected token `('
/bin/sh: __rvm_project_ruby_env_load_parse_file: line 9: ` __rvm_read_lines __variables <( { cat "$1"; echo ""; } | __rvm_sed "${__sed_commands[#]}" )'
/bin/sh: error importing function definition for `__rvm_project_ruby_env_load_parse_file'
/bin/sh: __rvm_remove_without_gems: line 2: syntax error near unexpected token `('
/bin/sh: __rvm_remove_without_gems: line 2: ` __rvm_read_lines __gems_to_remove <('
/bin/sh: error importing function definition for `__rvm_remove_without_gems'
Now I found if I run an illegal command for ruby, it gives me a same error message. So is it because my version problem?
To my mind, you need to install ruby first as the errors you're receiving are coming from BASH (it is trying to parse the script as bash but doesn't succeed). Not sure how you managed to install Homebrew without ruby.
I've had this error due to RVM being source'ed during bash profile setup.
It seems the RVM script cannot handle being sourced multiple times into the same shell.
This was being triggered by commands like ssh-agent, which spawn a new sub-shell, or simply running bash again.
My solution was to wrap the RVM source'ing in my .bashrc with a check for the $rvm_version variable:
if [ -z "$rvm_version" ]; then
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
fi

Resources