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
2
votes
0 answers

Analyzing squid3 access.log log files with a all-in-one shell script

I'm just going to write a shell script that me the essential functions such as SARG offers. Sort by URLs with most hits (Top100 in 10min out of 10k) Sum of status / error codes As well as sorting by URL's with Many bandwidth consumption and some…
tuxgirl
  • 21
  • 1
2
votes
1 answer

Does script execution time cut into idle logout time with ssh?

On one of our Mac OS X servers, we have set the following in /etc/ssh_config: # Keep idle connections alive for 10 minutes Host * ServerAliveInterval 600 Two questions: 1) Is this a good way to define a timeout limit for idle connections?…
2
votes
1 answer

I need a command to create a unique fingerprint from unix machine

I need to create a serial number for my application in a Unix machine. The generated serial number should be unique Do not change over time (Only changes after hard drive or mother board changes) Do not need root privilege. I found that, in Ubuntu…
a.toraby
  • 121
  • 4
2
votes
0 answers

Restart ffmpeg process streaming rtmp video if it fails using shell script

We use ffmpeg to forward streams live. Often due to unknown reasons or due to the stream stopping temporarily the command stops running in the background. What's the best way to monitor and continue to retry the ffmpeg command in an infinite…
Ben
  • 121
  • 5
2
votes
1 answer

A way to update the plain text password to ssha in Open ldap for 400K Users

Is there any command/extension available to update the "userPassword" attribute from a user object in LDAP server to SSHA hashed passsword from plain text? we found that users in LADP are stored in plain text. Once we enable the password policy new…
2
votes
3 answers

password check in bash script calling on expect

Background: I have to copy a file from one server, to over 100 servers in a test environment. once the file is copied, it requires to have the permissions on the file changed/verified. These are all linux servers. most of them have the same password…
2legit2quit
  • 171
  • 1
  • 2
  • 10
2
votes
0 answers

Running inotifywait on startup of machine

I want to start this inotifywait script on startup of the machine, in order to monitor the folders from the moment of booting: #!/bin/bash while inotifywait -r -e modify,attrib,close_write,move,create,delete /var/www/htdocs /administrator…
Biffy
  • 121
  • 2
2
votes
1 answer

Operator \> and \< (string version comparison) are not recognised in shell script

I am trying to run Casandra nodetool and getting warnings coming from .sh script. [root@d11ca4cc-fa95-c8a9-e133-e64c434f0e6f ~]# nodetool status /opt/local/share/cassandra/bin/nodetool[53]: .[97]: [: <: unknown…
2
votes
4 answers

how to run the dialog command with proccess

Please look on my code – ( bash script ) I want to display both dialogs on the screen on the same time, one dialog display the: tail –f from - /var/log/proccess1.log , and the second dialog display the: tail –f from the file -…
maihabunash
  • 443
  • 1
  • 11
  • 25
2
votes
0 answers

Bash and background processes PGID and receiving signals

My actual problem is that a process I run in an rcfile in docker as docker run container bash --rcfile rcfile remains attached to the bash session by sharing the PGID which means that when I Ctrl-C an unrelated command the process receives a…
2
votes
1 answer

How to view two dialog boxes on the linux console, running on the same time?

I want to view on the Linux console two dialog windows on the same time. I want a window that views the progress BAR, and the a second tailbox that view the logs are running. The problem is that the dialog appears always in the center of the…
maihabunash
  • 443
  • 1
  • 11
  • 25
2
votes
2 answers

Bash: Execute command from variable without eval

I have a problem with a script which should execute a curl command composed from the given arguments. It works if I use eval in the subshell, however, I would like to avoid that as it seems to be bad style according to this Here is the relevant part…
Jonas
  • 133
  • 1
  • 1
  • 5
2
votes
1 answer

ways to automatically fix line endings in shell scripts or files who break with ^M

Problem We regularly break our files lines endings and things stop working without us noticing. Bash complains about "invalid option" or ": command not found" as described here:…
pyb
  • 216
  • 2
  • 7
2
votes
1 answer

Inspecting how $PATH gets created

Is it possible to "listen" to a variable's value during the start of a new shell? I have a script that checks for the $PATH variable in the typical places, but I'd like to try something different. Here's what I'm thinking: Instead of just guessing…
brock
  • 123
  • 3
2
votes
1 answer

Terminate remote process when backgrounded ssh session is terminated

So right now I have a bash script that runs a command on a remote machine using ssh. The machine running the bash script is a Linux machine and the remote machine is a Windows machine running cygwin. The bash script contains the following…
UrbenLegend
  • 121
  • 1
  • 3