Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

A shell script is a script written for the shell, or command line interpreter, of an operating system.

-1
votes
0answers
20 views

Find all (Live) IP Addresses on a CentOS 7.3 Machine

I'm running under CentOS 7.3 and using the Bash command line I would like to accomplish two things: Get all IP addresses associated with any physical NIC (whether or not that physical NIC has an ...
0
votes
2answers
14 views

ubuntu script to retain only latest file of each folders and delete everything else

We have a script which takes hourly backups and stores it inside a folder created as today's date. #CRONJOB TO BACKUP DB HOURLY DAY=$(/bin/date +%d%m%Y) TIME=$(/bin/date +%H%M%S) if [ ! -d /home/...
0
votes
2answers
21 views

how to extract json file using awk/sed?

Input data.json { "lastUpdateTime" : "2018-07-20T10:56:26.000Z", "items" : [ { "date" : "2018-07-19T21:09:27.000Z", "user" : "dddd", "size" : 5219402, "rawSize" : 15658206, "...
0
votes
0answers
8 views

How to Read build parameters in shell script in Pipeline

I need to pass the parameter to my shell script command in pipeline script. Example : node { def buildNum = "${env.BUILD_NUMBER}" stage ('Run command'){ sh ''' docker exec ...
0
votes
1answer
35 views

Can't Export in Powershell

Am new to PowerShell, and I'm trying to make a simple script that lists all folders and files in a drive that shows the last modified date and the size and then export them to a cvs. so far I have ...
10
votes
2answers
1k views

How to edit Excel file (xlsx) using linux shell

Is there a way (tool) to edit XLSX files using Linux shell? What I need is a way to remove the last three not empty rows from the first worksheet. I know that XLSX is just a zip file, packed with ...
-1
votes
0answers
1k views

Creating multiple Nagios GUI users via script that uses REST API

I need to create a lot of Nagios logins for the Nagios XI GUI and would like to use the API that Nagios provides to create a script that would allow me to bulk add up to 500 users. These are the ...
0
votes
3answers
57 views

Quit loop if a key is pressed

I want to exit the script if any key is pressed. #!/bin/sh while true; do df -h | head sleep 10 clear done Any suggestion?
1
vote
1answer
19 views

Handle filename with blank in shellscript

These are my folder structure. [set symbolic links here] /links/ [entity] /data/a 1/ #(folder name has blank) /data/b 1/ /data/c 1/ /data/d 1/ . . . I want to made symbolic link for each ...
0
votes
0answers
39 views

How to wait until services are ready

I have been setting up a Jenkins pipeline using docker images. Now I need to run various services like MySQL, Redis, Memcache, Beanstalkd and Elasticsearch. To wait the job until MySQL is ready, I am ...
0
votes
2answers
52 views

Why does FFmpeg add a second subtitle to my files, even though I explicitly only added one?

I have a bunch of MP4 files and subtitle files in a folder, each following the pattern of episode[num].mp4 and episode[num].ass. I wrote a small shell script to automate combining those into MKV ...
2
votes
1answer
39 views

How can I call a batch file within another batch file?

trying to call a batch file within another batch file the script completes the synchronization of the remote folders but then fails to call the other batch file. @echo off "C:\Program Files (x86)\...
0
votes
1answer
38 views

can't increment a variable inside a loop in a bash script

I am running a bash script in Ubuntu 18.04. The script needs to run a python script 10 times. I did the following testbash.sh script: #!/bin/sh count=1 while [ $count -le 9 ] do python /home/e/...
0
votes
1answer
42 views

How can I copy(or move) and rename multiple files from different directories using the unix cp command?

Let's say, under this directory: /home/data/ There are 100 folders, the name of these folders are 24538_7#1, 24538_7#2, 24538_7#3 ... to 24538_7#384. In each folder, there are many files and ...
1
vote
1answer
27 views

I have 2 versions of the same shell script. ASCII wise they are Identical, but only one executes correctly

I have 2 version of the same shell script file. ASCII wise they are Identical (Used Notepad++ Compare Plugin), but only one executes correctly. I ran FC /B on the windows command line to compare them ...

15 30 50 per page