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
4 answers

Make shell script executable upon extraction from zip

I have a shell file that is pulled from github and built into a zip using TeamCity. It is typically edited and put into github from a Windows machine. I need this shell script to be executable upon unzipping. How do I do this? Currently I have to do…
elgabito
  • 133
  • 1
  • 4
2
votes
2 answers

What are some optimized LAMP or LEMP stack scripts with email?

In the "let's try not to reinvent the wheel" perspective, I've been looking for a packaged LAMP (or LEMP) stack for some time now, not only the basic Mysql, Apache , PHP etc... but ideally stuff like APC, Postfix... basically something that would…
PatrickS
  • 360
  • 1
  • 3
  • 12
2
votes
2 answers

awk + perl + get two arguments in to awk syntax

please advice what wrong with my awk syntax and how to fix it ( this syntax is in my ksh script ) and I run my script on linux machine my target is to get from the file.txt only the lines that between the dates: FROM 2012-04-19 TO …
yael
  • 2,433
  • 5
  • 31
  • 43
2
votes
1 answer

nl command + number each line in a text file only from the third line

I want to number each line in a text file on Linux/solaris by nl command but only from the third line - is it possible ? and if yes please advice how ? for example line1 line2 1 line3 2 line4
yael
  • 2,433
  • 5
  • 31
  • 43
2
votes
3 answers

FreeBSD rc.d script doesn't work when starting up

I am trying to write a rc.d script to startup the fastcgi-mono-server4 on FreeBSD when the computer starts up - in order to run it with nginx. The script works when I execute it while being logged in on the server - but when booting I get the…
kastermester
  • 177
  • 8
2
votes
2 answers

Tomcat server getting restarted frequently

We have a script like below to monitor our server. During this code our server getting restarted. Can anyone please explain the meaning of below script? if [ -f $HOME/catalinamonitor ]; then echo JVM failed; export JAVA_HOME=/usr/java/jdk1.6.0 …
Selvakumar P
  • 305
  • 2
  • 8
  • 16
2
votes
2 answers

Shell script to change uid for user

I have a file (users_uid) with users and uid are two parameters as given below : assds 611 dsdsd 612 xyzx 613 rerer 614 These users exist in the machine. I want to change the uid of each user to that value given right for the…
nitins
  • 2,579
  • 15
  • 44
  • 68
2
votes
6 answers

Copying files from a server to a set of machines

First of all I am not a trained professional in Networking nor I know much about it. I have some knowledge of GNU/Linux, Shell scripting. One day I wanted to copy a large zipped file to a set of computers in my lab and have to do some other tasks…
user71866
  • 221
  • 2
  • 7
2
votes
1 answer

Bash Function to Export .bashrc to a Remote Server

I am trying to write a bash function shown below. I am trying to scp my .bashrc to the target machine. I want to do modify the following function in the below two ways. I want to enter the password only once. Can I cache the password entered for…
liv2hak
  • 303
  • 4
  • 13
  • 25
2
votes
3 answers

LDAP Account Expiry Script Help

I need to find a way of automatically notifying LDAP account users as to when their passwords will expire and also force them to change their passwords. I am fairly new to LDAP.I am running openldap 2.3.43.el5 on RHEL 5.3 I am trying to find a…
Dominiqs
  • 167
  • 3
  • 7
  • 12
2
votes
2 answers

pam_exec.so PAM module does not export variable PAM_USER as stated in the documentation

I'm trying to use the pam_exec.so PAM module to execute a script which needs to know the username/password coming from the application (OpenVPN in this case). I have a script that executes printenv >>afile, but I don't see all the environment…
davidparks21
  • 928
  • 1
  • 12
  • 27
2
votes
4 answers

Shell script to scan size of directories and email when too big

I am at work right now, and my superiors asked me to write/find a shell script for the Red hat Server edition that checks a folder size, and if it's above a certain limit, it will send an email.Can anyone here help me find or help me create a script…
Jayakrishnan T
  • 298
  • 2
  • 8
  • 22
2
votes
2 answers

Date calculation in linux

In linux how to get the date of the first day of the week monday. I know that date +"%u" gives the current day of the week from this how to get the date of the monday of that week
Rajeev
  • 251
  • 1
  • 4
  • 10
2
votes
4 answers

how to change permissions of specific file type

file * | grep 'ASCII text' | chmod -x chmod: missing operand Try `chmod --help' for more information. The above command gives me error.Basically I am trying to find all the files whose type is ASCII and change their permissions to -x.What…
Registered User
  • 1,463
  • 5
  • 18
  • 37
2
votes
2 answers

What is the best Android phone for remote ssh administration/scripting?

I've got a Moto Droid that I use with connectbot for remote admin on Linux webservers. However, I'm wondering if there are any Android phones out there with better hard keyboards for use with ConnectBot. I basically want/need easy access to the…
sea6ear
  • 21
  • 3