Hot answers tagged

9

You are running sh -x ETL_AUTOMATION/Scripts/export.sh. This means that export.sh is being run by sh and not bash. On Ubuntu, sh is a simple POSIX shell called dash and that doesn't support the [[ construct, which is a bash thing. So just change your script so that it is launched with bash instead of sh. I don't know the Jenkins syntax at all, but I suspect ...


2

Using GNU grep if available, you can do this grep -Po "(?<='dbname' => ).*(?=,)" file In your script: DATABASE=$(grep -Po "(?<='dbname' => ).*(?=,)" $FILE_NAME) DATABASE_HOST=$(grep -Po "(?<='host' => ).*(?=,)" $FILE_NAME) DATABASE_PASS=$(grep -Po "(?<='password' => ).*(?=,)" $FILE_NAME) DATABASE_USER=$(grep -Po "(?<='...


1

On my phone now but you can use the logger command: logger "message to display including $variables`


1

Your script restart.sh use the systemctl command, which is part of systemd; because this command needs root rights due to his role, you need to use the sudo command to be able to use it (and your user must be refered in sudoers as an authorized sudo user). Your command would be like below : sudo /home/myuser/restart.sh /home/myuser/restart.sh is just the ...


1

I added this little function to my .bashrc as a replacement for beep: beep () { if [ "$1" = --list ] then find /usr/share/sounds -type f -exec basename {} \; | sort -n | tr '\n' ' '; echo else paplay $(find /usr/share/sounds -type f -iname "${1:-bell}*" | head -1) fi } It searches for a file in /usr/share/sounds starting ...


Only top voted, non community-wiki answers of a minimum length are eligible