0
votes
2answers
37 views

move all files in local directory to remote directory

I want to move all files in local directory to remote directory. And I am using this code to achieve itSOURCE_FILE=/var/www/oneserver/*TARGET_DIR=/var/www/anotherServerARCHIEVEFILE=/var/www/...
0
votes
1answer
20 views

How to copy environment variables from local shell to a remote ssh connection inside a shellscript?

I am currently working on a shell script that is used to build docker images and restart containers running on the remote host. below is the stripped down version of the code.#!/bin/bash -xe# ...
1
vote
1answer
20 views

Terminal is not running any command after using command “cat > .bashrc”

I was customizing my terminal by screenfetch. after installing screenfetch in my ubuntu, I have used some commandcat > .bashrc# Start Screenfetchscreenfetchthen I pressed ctrl + d and closed ...
0
votes
2answers
26 views

Bash scripting: run a shell command from inside a script with variable inside quotes

I need to load a db into a mysql server and the following command works from the shell:From shellmysql -h "172.17.0.2" -u "root" "-pmypasswd" -Bse "create database mydb;"But not from the script, ...
0
votes
1answer
40 views

Assign values to variable from text file. Search for the string in file. Replace the string in file?

I am working on a project where I need to correct some thousand lines of data. I have already completed the half work and now I am stuck on final part.I have a file called tree.txt which has list of ...
0
votes
0answers
37 views

Cronjob taking a screenshot every hour with scrot

One of my users needs a webpage screenshoted every hour. I was able to find a utility called scrot and it was easy setting up a cronjob to run every hour. My issue is it takes a screenshot of both ...
0
votes
1answer
18 views

What is producing an inconsistent conditional find result?

I'm writing a small script that gets assorted file stats about two different file extensions (*.parquet OR *.metadata) in an arbitrary directory. I need to get these file stats only from files that ...
0
votes
1answer
42 views

CentOS 7: Can't connect via WinSCP when bash is executed

I'm running CentOS Server 7 on a VM (ESXi) with root permissions. I have a bash script (in my /etc/profile.d/ directory) which is executed immediately after login. Before I created my .sh file in the ...
0
votes
1answer
22 views

From bash script, play sound through internal speakers, while leaving them effectively disabled otherwise

I posted a similar question earlier, but Kamil Maciorowski correctly & wisely pointed out that, as posted, it wasn't really the single problem it appeared to be, but an amalgam of 3. So I deleted ...
0
votes
1answer
51 views

Can you have a terminal file in Linux like windows Batch? What is the extension?

It has been a while since I downloaded my Kali Linux on a Windows virtual machine (VirtualBox not VMware). On my Windows host I have created numerous batch scripts that can execute "cmd code" with a ....
3
votes
2answers
148 views

How to force bash script to wait for user answer?

There are already similar questions but I'm posting this because none of the answers worked.I'm writing a bash script to automate the installation of pacman and AUR packages on my Arch system. The ...
0
votes
1answer
33 views

Extract tar.gz files into a directory with different basename based on their match in the text file

I have hundred of folders, some with with tar.gz files and some with bam files. I just wanted to extract tar.gz files into a different directory. Folders with tar.gz files looks like mentioned below:...
2
votes
2answers
50 views

Detect if command has printed to stderr

I have this program in C#include <stdio.h>int main() {char foo[10];int i;for(i=0; i < 20 ; i++) {foo[i]=0;}return 0;}If I run this script#!/bin/...
0
votes
2answers
98 views

How can I make this Bash variable work: myformat=“--format=fuller --date=format:%Y-%m-%d T%H” [on hold]

This is a question about how Bash handles word grouping and variable expansion. I will demonstrate the question with a very specific example:bash$ git log --format=fuller --date=format:"%Y-%m-%d T%H"...
0
votes
0answers
7 views

How to forcefully stop an endless loop in Upstart “pre-start script”?

I have the following pre-start script in one of my Upstart configurations:pre-start scriptcd "$(dirname "$(dirname "$(readlink "/etc/init/${UPSTART_JOB}.conf")")")". "lib/upstart/waitFor[...]....

153050per page