Tagged Questions

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

learn more… | top users | synonyms (1)

-2
votes
0answers
39 views

Unix script to connect 4 different servers [closed]

Possible Duplicate: Automatically run commands over SSH on many servers I need to create a script which will connect 4 different servers one by one, and check if the server is running then ...
2
votes
4answers
57 views

What does exit do in an if block in a shell script?

I have a question regarding unix shell script. Say if you do exit 1 in inner if: will it exit or will it still execute the outer if? The following is a dummy example. if [ "$PASSWORD" == ...
2
votes
2answers
35 views

Parse apache logs to exclude IP ranges

I need to look for some requests in a huge pile of apache logs. My only requirement is this: I need to only view the requests coming from any IP address that is NOT included in a list of 50 IP ranges ...
1
vote
0answers
13 views

Run one-line bash command in tcsh [closed]

Possible Duplicate: Syntax errors in a bash script executed from tcsh I write the line below in order to verify if first or second fields of list of numbers are equal to 146. I want to ...
2
votes
2answers
45 views

Download from dynamically changing urls via script

I want to write a script to download all Walter Lewin lectures from this page in wmv format: http://videolectures.net/mit801f99_physics_classical_mechanics/ However the links to the wmv file for ...
2
votes
1answer
35 views

gnuplot shell variable substitution and arrays

I need to use shell variables in my gnuplot commands, for which I'm using the here document style. I also need to use loops inside the gnuplot code. Both these things are working. Now -- I want to ...
1
vote
3answers
55 views

Shell script to become root

How can we write a shell script to become root? That is I donot want to input the password at prompt it should be within the script itself. I was trying to make but failed to do so.Is it possible, if ...
2
votes
1answer
37 views

Parameretrize file descriptor number to open a tcp socket in shell script

I'm tried to parameretrize in a variable the file descriptor number to open a tcp socket using exec command but it failed. Only work correctly when file descriptor number is a constant. In the next ...
-1
votes
2answers
62 views

please help with my script [closed]

I need to write a simple homework script for my Unix 101 course. I need to take a directory name from the user, and list how many things are in it. For some reason it doesn't work and gets the next ...
1
vote
3answers
50 views

solaris 10 + display 2 lines after match by grep?

I want to match for example: The string e1000g0 from the lltconfig -a list , and then to display the two lines after the string e1000g0 so I get only the lines: Node 0 du1a : ...
0
votes
1answer
88 views

How to effectively use bash scripting (different cost reductive ways and good habits)? [closed]

This is one of the most perennially important questions. How to effectively script ? What are the bad ways and what are the good ways ? I know of some, which i will point out here. If anybody does ...
2
votes
1answer
50 views

Executing a script from Nagios event handler fails to run

I have Nagios running on a webserver. For this one Nagios service check in particular, if it fails, it will run a script. This script is triggered via Nagios event handlers. Nagios event handler ...
4
votes
4answers
124 views

Executing user defined function in a find -exec call

I'm on Solaris 10 and I have tested the following with ksh (88), bash (3.00) and zsh (4.2.1). The following code doesn't yield any result: function foo { echo "Hello World" } find somedir -exec ...
2
votes
2answers
60 views

Requesting user input while reading file line by line

For class I need to write a Bash script that will take the output from ispell and when I try and request user input inside the while loop it just saves the next line of the file as the user input. ...
1
vote
2answers
80 views

Is there an easy way to create a FreeBSD rc script?

I have a FreeBSD jail in which I run a server using the command: /usr/sbin/daemon /path/to/script.py At the moment I have to run this command every time I restart the machine and the jail starts. ...

1 2 3 4 5 35
15 30 50 per page