06-04-2010
anchal sorry for typos. they are not in actual code, i always change the code variables before i pase them here. thats why all these typos.
i m going to run what all u said and will tell u the output soon.
thanks a lot
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I have a space delimited file containing: hostname OracleSID connectstring
I want to loop through the file and execute remsh to check the database processes.
cat $filename | while read HOST SID CONNECT
do
{
result=`remsh $HOST "ps -ef | grep pmon_${SID}$| grep -v grep"`
if ........ (1 Reply)
Discussion started by: joettacm
1 Replies
2. Shell Programming and Scripting
Hi Gurus
I have a file called /tmp/CMDB which looks like this
serial: 0623AN1208
hostname: server1
model: x4100
assetID: 1234
I am writing a for loop that will go through this file line by line creating a variable of itself. Using the first iteration of the loop (i.e. the first line) as... (6 Replies)
Discussion started by: hcclnoodles
6 Replies
3. Shell Programming and Scripting
I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends.
As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Discussion started by: DeCoTwc
2 Replies
4. UNIX for Dummies Questions & Answers
Hi,
im having problem creating a loop using my code: aside from the fact that the 1st variable (VAR) does not increment, it loops more than the expected output.
for sample purposes, test csv contains 3 lines.
#get number of lines in the file
lines=$( wc -l < test.csv )
... (5 Replies)
Discussion started by: paoie
5 Replies
5. Shell Programming and Scripting
Hi,
I am using su within a for loop. As you might expect, it prompts for password during each loop execution. Here is my piece of code:
for i in $LIST
do
if
then
DATABASE=`echo $i | awk -F "|" '{ print $1 }'`
USER_ID=`echo $i | awk -F "|" '{ print $2 }'`
su - apstage -c... (1 Reply)
Discussion started by: sugan
1 Replies
6. Shell Programming and Scripting
Hi all
Sorry for the basic question, but i am writing a shell script to get around a slightly flaky binary that ships with one of our servers. This particular utility randomly generates the correct information and could work first time or may work on the 12th or 100th attempt etc !.... (4 Replies)
Discussion started by: rethink
4 Replies
7. Shell Programming and Scripting
My need is :
Want to change
docBase="/something/something/something"
to
docBase="/only/this/path/for/all/files"
I have some (about 250 files)xml files.
In FileOne it contains
<Context path="/PPP" displayName="PPP" docBase="/home/me/documents" reloadable="true" crossContext="true">... (1 Reply)
Discussion started by: linuxadmin
1 Replies
8. Shell Programming and Scripting
I'm having problems with this example:
#!/bin/bash
for i in server1 server2 server3
do
ssh $i <<EOF >> logfile.txt
dat1=`date '+%m/%d/%y'`
hst=`hostname`
df -Ph | awk -v OFS=',' -v dat="$dat1,$hst" ' {print dat,$1,$6,$3,$4 } '
exit
EOF
done
I'm... (1 Reply)
Discussion started by: kuliksco
1 Replies
9. Shell Programming and Scripting
Hi All,
Below is the very simple code snippet but it si giving me syntax error
#!/bin/bash
#To ensure If JMS directory exists or not
ServerName=$(hostname)
#To ensure If JMS directory exists or not
echo $ServerName
if ;
then
echo "Inside First If"
if ;
then
echo 'JMS... (4 Replies)
Discussion started by: sharsour
4 Replies
10. UNIX for Dummies Questions & Answers
I'm taking a unix class and need to countdown to 0 from whatever number the user inputs. I know how to do this with a while or until loop but using the for loop is throwing me off....
I know I can use an if-then statement in my for loop but can I include a while loop in my for loop? (3 Replies)
Discussion started by: xxhieixx
3 Replies
LEARN ABOUT DEBIAN
mprompt
MPROMPT(1) mprompt MPROMPT(1)
NAME
mprompt - simple prompt-based control for mpd
SYNOPSIS
mpompt [-s] [-m key=key] [-t n] [-f] [tty] [-T] [host]
DESCRIPTION
mprompt is a mpd client with a prompt-based interface. It is designed to be usable on a headless machine.
At the prompt, enter the name of a playlist, or part of the name of an album, artist, or song. Matching items will start playing. You can
also paste in urls to stream.
(If the perl String::Approx module is available, it will be used to handle typos, etc in the names you enter.)
Use the left and right arrow keys to adjust volume, and the up and down arrow keys to move through the playlist.
The Tab and Enter keys can both be used to pause and unpause playback. (Enter toggles pause only if nothing has been entered at the
prompt.)
Example of how to run mprompt in /etc/inittab:
1:2345:respawn:/usr/bin/mprompt /dev/tty1
OPTIONS
-s This option allows shell commands to be typed in to mprompt, to be run by whatever user it is running as. (Typically root if it is run
from /etc/inittab).
To enter a shell command, type a "!", followed by the command to run, followed by Enter.
-m key=key
This option allows remapping keys. Any key can be remapped to any other key, which is useful to support keyboard with unusual key
layouts, or missing keys.
For alphanumeric and punctuation keys, individual symbols can be remapped. For example, "-m a=b" will turn each entered "a" into "b".
For other keys, use the following names:
<return>
<tab>
<space>
<up>
<down>
<left>
<right>
<backspace>
For example, -m "n=<down>" will map the "n" key to the down arrow, causing that key to change to the next track; -m "<space>=<return>"
will make the space bar act as a pause.
It's possible to swap keys too. For example, -m "<down>=<up>" -m "<up>=<down>"
A single key can also be bound to a series of keystrokes. For example, -m "1=Mule Variations<return>" will cause the "1" key to play
the "Mule Variations" album, a nice choice.
-t n
Adds a timeout, a specified number of seconds after which the entry on the command line will be cleared. Useful for headless systems,
to avoid cat-on-keyboard confusing your later commands.
-T Enables terse output mode. This mode tries to avoid displaying excessive or complex things, with the intent that mprompt's output can
be piped into a speech synthesiser, such as espeak.
SEE ALSO
vipl(1) mptoggle(1) mpd(1)
AUTHOR
Copyright 2009 Joey Hess <joey@kitenet.net>
Licensed under the GNU GPL version 2 or higher.
http://kitenet.net/~joey/code/mpdtoys
perl v5.10.1 2010-03-06 MPROMPT(1)