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

Questions tagged [shell-script]

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

0
votes
1answer
12 views

How to get the latest commit date of a file from a given github reposotiry?

Given a file in a Github repository such as https://github.com/user/project-name/blob/master/filename, and I wrote a shell script (or a function in a shell script) to download this file called ...
-1
votes
2answers
31 views

delete files older than 10 days and store the deleted file details in another file

I want to delete directories and subdirectories older than 10 days. Also, I want to store the deleted folder and file names, time details in another file. So far my script is to delete directories, ...
0
votes
0answers
23 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 ...
0
votes
1answer
92 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
21 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
39 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
8 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
54 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
50 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
37 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
35 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
40 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
47 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.

15 30 50 per page