04-27-2012
You'll get a better answer if you mention what system, what shell, sample input data and expected output. I suspect there is an easier way to get what you need but more detailed info is needed.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Guys,
I have a scripts that uses a while loop to read a file and set 2 variables.
How can I do this so the variables can be used outside the while loop ?
Below is an example....# ./junk2 -m -e user
EXE=user master=TRUE
DB_TAG=PRODUCT
In loop MST=MST=testsvr1:3110
In loop ARGS=... (2 Replies)
Discussion started by: Tornado
2 Replies
2. Shell Programming and Scripting
Sorry for such a dreadful title, but I'm not sure how to be more descriptive. I'm hoping some of the more gurutastic out there can take a look at a solution I came up with to a problem, and advice if there are better ways to have gone about it.
To make a long story short around 20K pieces of... (2 Replies)
Discussion started by: DeCoTwc
2 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. Shell Programming and Scripting
Hi, say I have a simple sh script like this:
for i in a b c d
do
for j in 1 2 3 4
do
echo "$i $j"
done
done
and the output is
a 1
a 2
a 3
a 4
b 1 (20 Replies)
Discussion started by: marcpascual
20 Replies
5. Shell Programming and Scripting
Can we assign two variables in a for loop?
I have an input file:
000301|20100502
835101|20100502
I want to read this file in a for loop and assign values to two different variables.
I did this now but did not work
for STORE,RUNDATE in `awk -F\| '{print $1,$2}' inputfile
... (4 Replies)
Discussion started by: gpaulose
4 Replies
6. Shell Programming and Scripting
Hi,
I need help on for loop need to add domain and IP
In domain list
1.com
2.com
3.com
In Ip list
1.1.0.1
1.2.0.1
1.3.0.1
1.com 1.1.0.1
2.com 1.2.0.1
3.com 1.3.0.1
I need to excute this command (4 Replies)
Discussion started by: ranjancom2000
4 Replies
7. Shell Programming and Scripting
Greetings. I'm completely new to shell scripting and quickly trying to catch on. Here's my scenario:
I have a text file, named ip.txt, containing IP addresses. I want to automatically perform a whois query on each address in the file, search the output for the country, and then put both the IP... (4 Replies)
Discussion started by: molnir
4 Replies
8. Shell Programming and Scripting
Hi,
I have a out from a command i need to grep a report. For that i need loop 3 variable for that. How i can loop need help.
Symmetrix ID : 123456
Masking View Name : Host16
Last updated at : 04:13:06 PM on Thu Mar 17,2011
Initiator Group Name : Host16
Host... (3 Replies)
Discussion started by: ranjancom2000
3 Replies
9. Shell Programming and Scripting
I am pretty new to Unix. Trying to pick up some slack while a coworker is out on vacation.
Basically the script is working fine however when I go through the testing phase and have to make mods it is a pita.
Here is an example of what I have
#!/bin/ksh
if
then
echo... (8 Replies)
Discussion started by: biobill
8 Replies
10. Shell Programming and Scripting
Hello, please assist:
users="test1 test2"
keytest1="abcd"
keytest2="dbcd"
for i in $users
do
echo "$key${i}" > fileout
done
So, my objective is to take the current user (ie test1) in loop and echo its associated keyname (ie keytest1) variable to a file.
The echo... (2 Replies)
Discussion started by: motdman
2 Replies
LEARN ABOUT NETBSD
esdctl
esdctl(1) User Commands esdctl(1)
NAME
esdctl - Enlightened Sound Daemon (esd) control program
SYNOPSIS
esdctl [-h] [-s hostname:port] command
DESCRIPTION
The esdctl utility is a command-line control program for the Enlightened Sound Daemon (esd).
OPTIONS
The following options are supported:
-s hostname:portContact the esd server on hostname at port. You can also specify this option as follows:
--server=hostname:port
-h Display help text, and exit.
OPERANDS
The following operands are supported:
command The following commands are supported:
allinfo Get player and sample information from the server
cache sample Cache a sample in the server
free name Uncache a sample in the server
getid name Retrieve a sample id, given the sample name
lock Do not allow foreign clients to use the server
loop name Make a cached sample loop
off Suspend sound output so that other programs can use the audio device (this is the same as the standby
option)
on Resume sound output so that only esd can use the audio device (this is the same as the resume option)
pansample id lefSetidefault panning for a sample, where id is the sample ID, and left and right are integers in the range 0
to 255
panstream id lefSetipanning for a stream, where id is the stream ID, and left and right are integers in the range 0 to 255
play name Play a cached sample once
resume Resume sound output so that only esd can use the audio device (this is the same as the on option)
serverinfo Get server information from the server
standby Suspend sound output so that other programs can use the audio device (this is the same as the off option)
standbymode Check whether the server is on standby
stop name Stop the looping sample at the end
unlock Allow foreign clients to use the server
EXAMPLES
Example 1: Putting esd into Standby Mode
example% esdctl standby
Example 2: Ending Standby Mode
example% esdctl resume
Example 3: Loading a sample into the esd cache
example% esdctl cache info.wav
Sample <3> uploaded. Name = esdctl:info.wav
This output indicates that the sample id is 3, and the sample name is esdctl:info.wav.
Example 4: Getting a sample id from the esd cache
example% esdctl getid esdctl:info.wav
Example 5: Playing a sample from the esd cache
example% esdctl play esdctl:info.wav
Example 6: Playing and looping a sample
example% esdctl loop esdctl:info.wav
Example 7: Stopping a looped sample that is being played
example% esdctl stop esdctl:info.wav
Example 8: Removing a sample from the esd cache
example% esdctl free esdctl:info.wav
Example 9: Setting panning for a stream
example% esdctl panstream 1 100 155
Example 10: Setting panning for a sample
example% esdctl pansample 1 155 100
EXIT STATUS
The following exit values are returned:
0 Application exited successfully
>0 Application exited with failure
FILES
The following files are used by this application:
/usr/bin/esdctl Executable for Enlightened Sound Daemon control program
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWgnome-audio |
+-----------------------------+-----------------------------+
|Interface stability |External |
+-----------------------------+-----------------------------+
SEE ALSO
esdcat(1), esdplay(1), esdrec(1), esdsample(1), esdmon(1), esd-config(1), libesd(3)
NOTES
Written by Brian Cameron, Sun Microsystems Inc., 2003.
SunOS 5.10 8 Jan 2003 esdctl(1)