Sponsored Content
Top Forums Shell Programming and Scripting question to build a shell script Post 302150007 by vishalpatel03 on Sunday 9th of December 2007 07:13:07 PM
Old 12-09-2007
question to build a shell script

Hi
All,

I want to develope a script.
can you please give me solution to this script?

Several Processes Reporting Status back to a Master

Write two programs that communicate using message queues. One program (the
master) will receive messages periodically sent by multiple copies of the other
program (senders). The messages sent might simulate status or degree of
completion of a sender. Upon receipt, the master should print the message with
some identification of the sender. Prior to termination, each sender will send
a delimiter message. After receiving delimiter messages from all the senders,
the master will remove the message queue and exit.

eg.

assume the master's filename is msg_rpt_m

$msg_rpt_m
>From 14437: status mesg #1
>From 14438: status mesg #1
>From 14439: status mesg #1
>From 14437: status mesg #2
>From 14438: status mesg #2
>From 14439: status mesg #2
>From 14437: status mesg #3
>From 14438: status mesg #3
>From 14439: status mesg #3
>From 14437: status mesg #4
>From 14438: status mesg #4
>From 14439: status mesg #4
>From 14437: status mesg #5
>From 14438: status mesg #5
>From 14439: DONE
>From 14437: DONE
>From 14438: status mesg #6
>From 14438: DONE
$

Thanks,
Vishal
 

10 More Discussions You Might Find Interesting

1. BSD

build kernel ,question?

# cd /usr/src/sys/i386/conf # cp GENERIC LOVEPP # cd /usr/src # make buildkernel KERNCONF=LOVEPP make:don't know how to make buildkernel. Stop Any suggestions? (I am using Freebsd4.8) (2 Replies)
Discussion started by: sheep
2 Replies

2. Shell Programming and Scripting

A shell script question

Hi, I have a file say xmldir.conf. This is a flat file which contains the data in specific format not other then this. The format is /backup/surjya/mvfile,noeof /backup/surjya/mdbase,eof /backup/surjya/mdbaseso /backup/surjya/trial,hoeof /backup/surjya/test,eof The field before "," is... (2 Replies)
Discussion started by: surjyap
2 Replies

3. Shell Programming and Scripting

Shell script question

Hello, i am doing a project for school and i cannot figure out whats wrong with my 2 programs they dont seem to work at all. the first program is called isprime and naturally it checks to see if hte number is prime or not here is my code: #!/usr/bin/bash num=$1 echo you typed if ... (2 Replies)
Discussion started by: jbou1087
2 Replies

4. UNIX for Dummies Questions & Answers

Linux Shell Question: how to print the shell script name ?

Suppose I have a script named "sc.sh" in the script how to print out its name "sc.sh"? (3 Replies)
Discussion started by: meili100
3 Replies

5. Shell Programming and Scripting

How to build a string in shell script

Hi all, I had a typical problem. I am using a parameter PK="PK1 PK2 PK3" i need to build the string a.PK1=b.PK1 and a.PK2=b.PK2 and a.PK3=b.PK3 Please help (8 Replies)
Discussion started by: nkosaraju
8 Replies

6. Shell Programming and Scripting

Need to build Shell Script to search content of a text file into a folder consist several files

Have to read one file say sourcefile containing several words and having another folder containing several files. Now read the first word of Sourcefile & search it into the folder consisting sevral files, and create another file with result. We hhave to pick the filename of the file in which... (3 Replies)
Discussion started by: mukesh.baranwal
3 Replies

7. Linux

Linux Shared Library build question...

I'm a bit new to Linux systems programming. I've been programming at the systems level for over 20 years on various other platforms, but I'm not as familiar with the GCC toolchain as I'd like to be (but I'm learning quickly)...;)... Our target is an ARM-based Linux Embedded system. We're using... (3 Replies)
Discussion started by: jcossette
3 Replies

8. Shell Programming and Scripting

Shell script to build directory tree and files

Hi all, I'm trying at the moment to write a shell script to build a directory tree and create files within the built directories. I've scoured through sites and text books and I just can't figure out how to go about it. I would assume that I need to use loops of some sort, but I can't seem... (8 Replies)
Discussion started by: Libertad
8 Replies

9. Shell Programming and Scripting

Build.xml invocation by Build Script

Hi I have a build.xml file and I can run it on Windows via cmd. Now I want to write a script to invoke the same. Is there a way to do this? (1 Reply)
Discussion started by: ankur328
1 Replies

10. Shell Programming and Scripting

Shell script question

I am getting error files missing. can anyone tell me I can able to read the file. Can you tell what the other part does? xargs -i test -f {} cat $S.file | uniq | xargs -i test -f {} || error_func "files(s) missing!" (4 Replies)
Discussion started by: ramkumar15
4 Replies
MESG(1)                                                            User Commands                                                           MESG(1)

NAME
mesg - display (or do not display) messages from other users SYNOPSIS
mesg [option] [n|y] DESCRIPTION
The mesg utility is invoked by a user to control write access others have to the terminal device associated with standard error output. If write access is allowed, then programs such as talk(1) and write(1) may display messages on the terminal. Traditionally, write access is allowed by default. However, as users become more conscious of various security risks, there is a trend to remove write access by default, at least for the primary login shell. To make sure your ttys are set the way you want them to be set, mesg should be executed in your login scripts. ARGUMENTS
n Disallow messages. y Allow messages to be displayed. If no arguments are given, mesg shows the current message status on standard error output. OPTIONS
-v, --verbose Explain what is being done. -V, --version Display version information and exit. -h, --help Display help text and exit. EXIT STATUS
The mesg utility exits with one of the following values: 0 Messages are allowed. 1 Messages are not allowed. >1 An error has occurred. FILES
/dev/[pt]ty[pq]? SEE ALSO
login(1), talk(1), write(1), wall(1), xterm(1) HISTORY
A mesg command appeared in Version 6 AT&T UNIX. AVAILABILITY
The mesg command is part of the util-linux package and is available from https://www.kernel.org/pub/linux/utils/util-linux/. util-linux July 2014 MESG(1)
All times are GMT -4. The time now is 06:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy