Questions tagged [shell-scripting]

Programming in an Interpreted language executed by a running Shell

Generic programming in an Interpreted language (as opposed to compiled) executed by a running Shell. Sometimes referred to as "Glue Code" due to the practice of managing the execution and output of one or more compiled binaries and passing said output to another series of commands.

621 questions
4
votes
2 answers

Unix separate multiple commands which has '&' (execute in background) in the end

To separate regular commands in Unix is to put semicolon in the end like this: cd /path/to/file;./someExecutable; But it seems not working for commands like this: ./myProgram1 > /dev/null & ./myProgram2 > /dev/null & =>./myProgram1 > /dev/null…
Stan
  • 1,387
  • 6
  • 24
  • 40
3
votes
1 answer

Why is eval not working with command substitution?

I have this command $("${DIR}/test.py" "$1") the output of which is export SOME_VAR="hello world" export ANOTHER_VAR="hello" But eval $("${DIR}/test.py" "$1") seems to do nothing. What am I doing wrong? I want to export those variables in my…
masterpiece
  • 115
  • 1
  • 1
  • 8
3
votes
0 answers

How to deploy a script to auto update google chrome on a lot of hp thin clients?

The hurdle is that the thin client wipes and re-images itself every night and I have no access to group policy. Any ideas of deployment or the most efficient way to do this? What I do have access to is the following: Landesk - a program to connect…
3
votes
2 answers

how to determine SYS_UID_MIN, SYS_UID_MAX (etc.) values from a script?

I'm wishing to query the values SYS_UID_MIN,SYS_UID_MAX, SYS_GID_MIN, SYS_GID_MAX from a shell script. These values appear commented out in /etc/login.defs . Hopefully this reflects the default values, but this is not certain. Somehow the program…
lickdragon
  • 161
  • 2
  • 9
3
votes
1 answer

Vagrant provision : shell script install mariadb-server on Debian prompt error

I'm looking for provisioning a Debian 8.2 Virtualbox VM with MariaDB 10. I use the following : sudo export DEBIAN_FRONTEND=noninteractive sudo debconf-set-selections <<< "mariadb-server mariadb-server/root_password password $ROOTDBPWD" sudo…
3
votes
0 answers

OSX Terminal.app seems to become 'suspended' unless I VNC into the Mac

So I have a bit of complicated setup, but let me see if I can simplify I am running a mono application on a remote OSX machine. This application can occasionally hard-crash the mono runtime. There is a recovery shell script running every 2 minutes…
Richthofen
  • 275
  • 1
  • 4
  • 8
3
votes
5 answers

Check if remote mysql is running

I want a bash shell script that i can run using a cron job to check if mysql on a remote server is running. If it is, then do nothing, other start the server. The cronjob will be checking the remote server for a live (or not) mysql every minute. I…
The Georgia
  • 151
  • 1
  • 1
  • 2
3
votes
2 answers

Using curl with cookies

I hope someone can help me out on this one. I have been trying this for a while now, with all sorts of variations and cannot seem to get this to work. I am trying to script a way to log in to https://login.three.ie/ to check account balance from…
user1718443
  • 31
  • 1
  • 1
  • 2
3
votes
2 answers

Looking for a way to wrap a command and give its own shell

I am working with the command line executing the same commands many times manually following the same pattern. Now I am looking for a way to simplify it by just typing the command only once. Lets take a look at a normal docker example: docker…
Vad1mo
  • 268
  • 2
  • 15
3
votes
2 answers

Read mail from Postfix using shell script

I would like to be able to read incoming mail from a Postfix MTA using a shell script. The shell script should be able to retrieve the mail headers, subject, body, attachments, etc., then mark the mail as read. The messages are stored in the…
Jim Walker
  • 321
  • 1
  • 3
  • 10
3
votes
1 answer

Passing variables in kickstart

I have a kickstart file that takes a hostname in the %pre section. I cannot seem to figure out how to get it two the first. As you see it sends the server information to another device which then customizes the server based on another database. I…
ThatGuy
  • 293
  • 1
  • 2
  • 9
3
votes
3 answers

Year Month day from file name in shell script

I hava file names like below adn_DF9D_20140515_0001.log adn_DF9D_20140515_0002.log adn_DF9D_20140515_0003.log adn_DF9D_20140515_0004.log adn_DF9D_20140515_0005.log adn_DF9D_20140515_0006.log adn_DF9D_20140515_0007.log i want get the year, Month,…
user3319390
  • 31
  • 1
  • 3
3
votes
1 answer

Replacing LineFeed \x0a with SED

I have to delete lots of Linefeeds (Hex \x0a) in a logfile. I just have sed to solve the problem. It is a bit complicated I know.. Do you have idea how to solve the problem? Here is an example…
Fake4d
  • 603
  • 7
  • 10
  • 16
3
votes
3 answers

power shell error: Cannot bind parameter

when i am trying to execute the below PowerShell command, i got error . The command : *PS cert:\currentuser\authroot> gci | where subject -like "UTN"* The error is below : Where-Object : Cannot bind parameter 'FilterScript'. Cannot convert the…
mustaque
  • 101
  • 1
  • 2
  • 5
3
votes
4 answers

Bash one-liner that shows a running countdown until a DNS update (TTL expiration)

I find myself frequently tasked with updating DNS records and needing to know exactly when the refresh will begin (a.k.a TTL expiration). I came up with this bash one-liner that gives me the output I want: $ dig +noall +answer www.google.com | \ >…
luckman212
  • 153
  • 7