![curl works but when assigned to variable in script it hands curl works but when assigned to variable in script it hands](https://venturebeat.com/wp-content/uploads/2019/05/NET-5.png)
- Curl works but when assigned to variable in script it hands password#
- Curl works but when assigned to variable in script it hands download#
Without debug options it is just like this. s3fs.cpp:set_s3fs_log_level(297): change debug level from to Sudo /usr/local/bin/s3fs s3bucketname /home/ubuntu/s3bucketmountfolder -o allow_other -o uid=1000 -o mp_umask=002 -o multireq_max=5 -o use_path_request_style -o url= -o dbglevel=info -f -o curldbgĪdding debug options to the command give such an output when run in script file.
Curl works but when assigned to variable in script it hands password#
Now without password file option the command works fine with shell script, and NOT working in shell script file, same problem.
![curl works but when assigned to variable in script it hands curl works but when assigned to variable in script it hands](https://feranto.github.io/azure-apim-lab/Images/APIMSecurityCreateKV.png)
curl url > local-file The progress bar shows how much of the file has been downloaded so far.
Curl works but when assigned to variable in script it hands download#
I have solved the password file problem by removing the option and setting credentials in the default password file. If you specify a URL that leads to a file, you can use curl to download the file to your local system. I want to make it automount on instance start/reboot, and thinking of running the script with cron's is it: sudo /usr/local/bin/s3fs s3bucketname /home/ubuntu/bucketmountfolder -o allow_other -o uid=1000 -o mp_umask=002 -o multireq_max=5 -o use_path_request_style -o url= -o passwd_file=/home/ubuntu/passwd A command to mount s3 bucket on AWS instance as a folder. bin/sh: symbolic link to file -h /bin/bash File is passed in option with absolute path, eg /home/ubuntu/file
![curl works but when assigned to variable in script it hands curl works but when assigned to variable in script it hands](https://venturebeat.com/wp-content/uploads/2018/08/22gFld3f.jpg)
I believe both of these approaches work by breaking the single-quoted string into two single-quoted substrings, each adjacent to the expanded 1 environment variable. But exactly same commmand works perfectly in shell. In other words, in the above example, '1' works just as well as '''1'''. When running from script file, the file passed in an option is not accessible. Tried combining ALL combinations of header line and run command. Tried executing it like this: sudo sh script.shĪlso tried changing first line to #!/bin/bash I created a script file, starting with #!/bin/bash and then the command on next line. I also tried different variations of the path - in root folder, with ~ in front, different absolute paths. The path to the file in command and in script is absolute. It gives the same error as if the path to file was incorrect. When i run it from a script, the file specified in one option of the command is not accessible. But i need it to be run from a script file.