Questions tagged [shell-scripting]

Programming in an Interpreted language executed by a running Shell

Generic programming in an Interpreted language (as opposed to compiled) executed by a running Shell. Sometimes referred to as "Glue Code" due to the practice of managing the execution and output of one or more compiled binaries and passing said output to another series of commands.

621 questions
0
votes
1 answer

Taking input on remote vm

below is my use case , I have to take a input from a user for a specific command which need to run on a remote machine.But my problem is I am not able to access that machine directly so what I am doing Ssh to othere server and from their I am doing…
Mohan
  • 1
0
votes
1 answer

How return to prompt after execution of script that spawns a daemon?

$ cat appleclue.sh #!/usr/local/bin/bash source ~/.venv/appleclue/bin/activate cd ~/applications/appleclue/appleclue-web/ git pull pip install -r requirements.txt python3.9 manage.py migrate --noinput python3.9 manage.py collectstatic…
Victor Ribeiro
  • 161
  • 1
  • 6
0
votes
1 answer

FreeBSD: Cant stop program started by rc.d ("is not running")

I've created a rc script to start gunicorn as a daemon on boot. #!/bin/sh # PROVIDE: gunicorn_appleclue # REQUIRE: DAEMON .…
Victor Ribeiro
  • 161
  • 1
  • 6
0
votes
1 answer

How to automate ssh password Windows / Git bash - already with the installed software without needing to install

I have a VM that has the fixed snapshot, and I have not the right to install anything How I can achieve the goal? Passing password to ssh connection Windows 10, using git bash without needing to install anything and without needing to input a…
Nusrat Nuriyev
  • 101
  • 1
  • 6
0
votes
1 answer

On CentOS 8 in profile.d do I need to add my script related to environment variables to both an .sh and .csh file?

I need to add environmental variables related to proxy servers to allow my node.js app to communicate with reCAPTCHA Enterprise on Google Cloud. When I run the scripts from Accessing Google Cloud APIs though a Proxy communication with Google Cloud…
myNewAccount
  • 569
  • 1
  • 6
  • 19
0
votes
0 answers

Issues with Bash Script to SSH and Copy String Variables from a CSV to a remote file

Here is my script #!/bin/bash clear PSQLSTART="INSERT INTO TABLE (Name, Description, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12, Field13, Field14, Field15, Field16, Field17, Field18) VALUES" echo "What is…
mc587
  • 1
0
votes
0 answers

Using setuid in a Shell Script on Ubuntu 20.04

So I have a Laravel PHP app on Nginx on Ubuntu 20.04. I have a simple deploy.sh script that will: Put Laravel into maintenance mode, so it returns a 503 error if anyone visits the site Pulls down the current source from github using a read-only…
user621861
0
votes
1 answer

Jenkins vs shell scripts

why would Jenkins get a different result from shell scripts(redhat 7) alone? I have shell scripts that run fine if I execute them from a terminal, however when I run the scripts from Jenkins they get different results Jenkins 2.263.4
0
votes
2 answers

Best and simple way to prevent automatic backups filling all disk space in Linux, before it actually happens

Which do you think is the best and most simple way to prevent automatic backups filling all disk space in Linux, before it actually happens? I would like to automatically recycle the oldest ones when the disk reaches, let's say 85% full
0
votes
1 answer

Monitor Docker Container for No Output

I have a long running process in a docker container that is setup like this: Dockerfile ... ENTRYPOINT ["./invoke.sh"] invoke.sh #!/bin/bash ./long-running-command If long-running-command is running properly, it will send output to STDERR every…
Shaun
  • 13
  • 4
0
votes
1 answer

Diff says file does not exists – why?

I transfer a file from a remote server to my local server. If this is done I do a diff to check if both files are identical to check if the transfer was successful. So I do this: ssh -o StrictHostKeyChecking=no -l ${SSH_USER} ${SSH_HOST} "cat…
0
votes
1 answer

Run xterm script from /etc/profile leads to "cannot load font"

I want to auto-start a shell script and therefore I added this line to my /etc/profile: /bin/su -c "/path/to/my/script" user - the script itself starts a xterm shell command and output following error during autostart: xterm: cannot load font…
leon22
  • 101
  • 1
0
votes
1 answer

COMMAND TO DISPLAY SPECIFIC LINES IN A SCRIPT

I have a script containing 5 lines in it. what is the command to view only 1st and last line in the script in one single expression.
0
votes
0 answers

How do I get the Current time in milliSeconds in a Shell script in buildroot environment?

MYENV=$(date +"%s%N") printf "Time:: %s\n" "$MYENV" or MYENV1=$(date +"%T%N") printf "Time:: %s\n" "$MYENV1" I tried above methods, they do work in regular linux but not working in buildroot. 1606718041%N is the output being printed. What does…
0
votes
2 answers

Bash script to create variables from and run commands on each item in an external list

On my local machine I have a text file containing a list of IP addresses and directory names. list.txt # Comment for Server 1 XXX.XX.XXX.X DIRECTORY-NAME # Comment for Server 2 XXX.XX.XXX.X DIRECTORY-NAME # Comment for Server…
Jay
  • 157
  • 1
  • 7