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
16 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
0answers
25 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
24 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
19 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
41 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
42 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
35 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-...
0
votes
1answer
21 views

Restart on crash script check

I'm trying to make a shell script that checks to see if 2 different processes are running and to restart them if they aren't. I just want to keep it simple. Is this the correct way because it doesn't ...
0
votes
0answers
19 views

how to copy public key using ssh-copy-id silently

I am copying my public key to another machine using ssh-copy-id. $ sudo ssh-copy-id -i /home/vagrant/.ssh/id_rsa.pub vagrant@datanode1.com /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/...
0
votes
0answers
15 views

update value of PasswordAuthentication property as yes in /etc/ssh/sshd_config silently

I want to update /etc/ssh/sshd_config file with PasswordAuthentication as yes. I am able to do it using vi editor. is it possible to do the same silently with unix command.
0
votes
1answer
24 views

Linux find command- display files older than 7 days - without using timestamp

there is process which creates files in every half and hour. I want to remove files older than 7 days. But when I'm running this command its removing file older than seven days from current timestamp ...
2
votes
1answer
66 views

Find fails with “Too Many Arguments” in Shell Script, but not if run directly in a Terminal

I have a work station that stores images temporarily before compressed versions are uploaded to a server for safe keeping. I have an interest in deleting old files once a day at 3 AM using a script ...
0
votes
0answers
58 views

How to run Shell Script in windows with virtual Environment?

I have created virtual environment in my system with the directory called virt_env. I have installed necessary python scripts. Now I want to run .sh script from the same virtual Environment. If I ...
0
votes
0answers
27 views

How do I get this simple ffmpeg command to work in Automator?

I'm having trouble getting a simple Automator shell script to work. I'm trying to get an ffmpeg command line to run a task on a file that is dropped onto the appliaction icon. This is what i've done: ...

15 30 50 per page