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
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [shell-script]

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

0
votes
0answers
15 views

Run agt-get install imagemagick on raspberry pi using docker file

I am new to docker in rasppberry pi. I have installed docker on my raspi, and I wanted to create a docker image. This docker image when pulled into another raspi with docker should install imagemagick ...
-2
votes
0answers
48 views

Moving zero padded files based on sequence

I am trying to move repetitive generation of files in sequence like [00000.txt ... 99999.txt] and maintaining current date logs. I tried with the below script which is working for single digit ...
0
votes
1answer
88 views

Translating Windows script for use in Linux

I have this batchfile that I use in Windows that I would like to translate into a Linux script. Could anyone help with that? Here is the script and the attempt at a Linux version. I did not write this,...
0
votes
1answer
20 views

How to start a service at startup

I am using Ubuntu Server to make a Kodi box. I'm using kodi-standalone-service to do so. I have made a shell script (sudo -S <<< "password" systemctl start kodi) to start kodi. When I run it ...
0
votes
1answer
36 views

Bash Script That Inputs Strings Into a Command After Executing it

I want to make a script (in bash language) that allows me to automatically log in to service X. Service X will ask for my username and password, and I want my script to input them. Here's the code: ...
0
votes
0answers
7 views

Update values for particular key in kubernetes configmap

I need to update value for particular key in kubernetes configmap in shell script. Say I have one property COUNTRY_CODE: AAA. I need to change AAA to NONE. Manually what we do is kubectl edit cm -n ...
0
votes
1answer
43 views

Setting a variable based on the time of day

I cannot seem to get the if %day% EQU lines correct. I am trying to get the autoShutDown variable to "T" when the script is run between Friday night 8:30 PM and Saturday at 5:15 PM. But it seems like ...
0
votes
2answers
42 views

How to add QOS to Local Computer Policy with Powershell

I have this code and it works but it makes a domain GPO policy and not a local one. How do i get it to make it local? #Create QOS for RDP Session #Create a new Group Policy Object (GPO) that will be ...
0
votes
1answer
45 views

Changing Power Options with Powershell

I am a newbie when it comes to scripting. I am running the script above. I believe I have to take and change this line of code: {param ($Plan = $(throw ‘Set-PowerPlan Ultimate Performance’ ))} but I ...
1
vote
1answer
31 views

Why does command substitution not work in braces but replacing it with the actual number works?

I'm using the following command to try to max out the number of cores on my server: for i in {1..`nproc --all`}; do while : ; do : ; done & done For some reason, it only ever uses one core, even ...
0
votes
1answer
25 views

Print all commands in a bash function

I am trying to debug a bash function. Is it possible to print all the commands executed by a bash function? I know that it is possible to print all the commands by a bash script by changing #!/bin/...
0
votes
1answer
44 views

Replace lines after a given number of matches on separate lines with AWK

Currently I'm using AWK to find and replace a portion of a string after the first three occurrences of a pattern. The string is formatted like this: func(tempID="39849235",count='12');, and there are ...
0
votes
2answers
32 views

How can I get quotes to show up when I'm using AWK to find and replace?

Currently I'm using AWK to find and replace a portion of the first three occurrences of a string. The string is formatted as such, and there are many of these strings in the file: func(tempID="...
0
votes
1answer
46 views

Auto-lock (Win+L) computer if Ethernet cable is removed or Ethernet signals drops

I want to make my system auto lock whenever I disconnect the Ethernet cable or my LAN signals drops. I'm using Windows 7 and Windows 10.
1
vote
1answer
37 views

How to handle a .js extension correctly in bash script?

I have the following bash script. while IFS= read -r filename; do [[ $(md5 path/to/"$filename-orig") = $(md5 path/to/"$filename") ]] || echo $filename differs; done < path/to/list-of-files-to-...

15 30 50 per page