Skip to content
Advertisement

Tag: bash

Bash No such file or directory error

When I do It works fine. But when I do the same thing with I get ~/Desktop/out.txt: No such file or directory. Why? Answer Take the tilde out of the quotes so it can be properly expanded: You can also use ${HOME} if any subsequent part of your path contains spaces and you want to quote the whole path:

Bash script to install AWS CLI tools

I am writing a bash script that will automatically install and configure AWS CLI tools. I am able to install AWS CLI tools but unable to configure it. My script is something like this: I wish to do the configuration using this script too. I wish that I can provide these credentials via script so that it prevents manual entry.

Use Bash variable within SLURM sbatch script

I’m trying to obtain a value from another file and use this within a SLURM submission script. However, I get an error that the value is non-numerical, in other words, it is not being dereferenced. Here is the script: When I run this as a normal Bash shell script, it prints out the number of procs correctly and makes the

Calling shell script from C++

A shell script test.sh is called from C++ code by the command execl(“/system/bin/sh”,”sh”,”test.sh”) After the execution of shell script i need to get back the control to C++, but the shell script is just exiting not executing the next instructions in C++ code Answer You want to use fork to create a child process before you exec:

Print the alphabet in bash

I would like help with the following algorithm in bash (or anything accessible through bash shell): I give a number to some function, and based on that number I obtain a string of alphabet letters. Example: I do not wish to occupy more memory than I need, so approaches such as for i in {A..Z} or echo {A..Z} or echo

convert images to pdfs in subdirectories

I have a bunch of sub-folders with images in them. I am trying to recursively convert them into pdf files using the directory names as the pdf name. With the help of some Google searches I tried using this script I wrote: It did not work. How can I get this to work? Each folder has several .JPGs in it

bundle install not running from my post-update hook

I’ve setup a post-update hook for my project. I have a bare repository (/var/git/myproject) which I push to, and a live repository (/var/www/myproject) where my app is running. I also included bundle install and bundle exec rake db:migrate to install gems and update db. Below is my post-update hook When I push my changes though I get the following message

crontab not working under arch linux

I tried to set up a schedule to remove the old file and folder after several days. I put the following code in a script file and tried to use crontab to run it every day. The find command worked fine. but the crontab seems not execute the script file. I also use crontab for other tasks, i.e. rsync, they

Advertisement