Im new to C, and Im having a hard time getting a random number.
In bash, I would do something similar to the following to get a random number;
#!/bin/bash
seed1=$RANDOM
seed2=$RANDOM
seed3=$RANDOM
SEED=`expr $seed1 * $seed2 / $seed3`
echo ${SEED%.*}
Now, in online examples... (4 Replies)
Hello Everyone.
I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below:
if ; then
if ; then
tail +$1 $3 | head -n $2
else
... (5 Replies)
Hello All, I am stuck up in a program where the rand functions ends up giving all the same integers. Tried sleep, but the numbers turned out to be same... Can anyone help me out how to fix this issue ? I have called the srand once in the program, but I feel like when I call fork the child process... (5 Replies)
Can anybody tell me why the second part of this script (Sieve of Eratosthenes) isn't working properly. This isnt coursework or homework just private studies ( Yes Project Euler began it ) I know there are easier ways of doing this too but I want to do it this way.:p
Iam using Cygwin on Vista... (3 Replies)
Hi,
I have a series of data files for which I wish to plot using "splot". Say, the files names are like:
950_data,951_data,952_data,......1000_data.
For one file , say to plot 950_data, i write following lines into a single file and load it in the gnuplot as :
gnuplot> load 'plot'
... (6 Replies)
Hi there I am trying to generate a random number between 40 and 70 using the shell here is my code so far and it keeps going above 70. all help much appreciated!
comp=$(( RANDOM%70+40 ))
echo $comp (4 Replies)
Having a hard time with this. Very new to scripting and linux. Spent all sunday trying to do this. Appreciate some help and maybe help breaking down what the syntax does.
Create a Bash program. It should have the following properties
• Creates a secret number between 1 and 100
i. The... (3 Replies)
Hi Guys and gals...
As you know I am getting to grips with POSIX and hit this stumbling block.
Generating two random numbers 0 to 255 POSIXly. Speed in not important hence the 'sleep 1' command.
I have done a demo that works, but it sure is ugly! Is there a better way?
#!/bin/sh
# Random... (12 Replies)
Discussion started by: wisecracker
12 Replies
LEARN ABOUT DEBIAN
prepmx
prepmx(1) prepmx Manual Page prepmx(1)NAME
prepmx - preprocessor for PMX, easy music typesetting program
SYNOPSIS
prepmx [options] jobname [outdir/] [stylefile]
DESCRIPTION
M-Tx is an easy to use preprocessor language for the PMX music typesetting program, aimed at people who are not experts. For an easy exam-
ple, have a look at the following example:
c2+ e4 g | b4d- c1 d c2 |
c8 g+ e g c- g+ e g | d g f g c- g+ e g |
For syntax reference, please look at the M-Tx manual written by Dirk Laurie, the creator of the M-Tx language and the author of prepmx, its
command line utility.
prepmx processes the file jobname.mtx to generate jobname.pmx. You can then process this file using the `pmx' command. PMX is a pre-
processor for MusiXTeX.
outdir/ is the directory where `pmx' will put the final .tex file. Note that the trailing slash is mandatory. You can provide a stylefile
for M-Tx. If omitted, the file `mtxstyle.txt' in the current directory is used, if there is one.
OPTIONS
Options can also be specified in a `Options:' line in the preamble, which takes precedence over the command line.
-b never unbeam eighth notes and shorter
-c main music lines only - ignore chords
-D enable debug mode
-f use tonic sol-fa note names
-i ignore errors
-m music only - ignore lyrics
-n indent first system and print default instrument names
-t ignore uptext lines
-u uptext synchronizes with notes only, not rests
-v verbose progress report
-w enable pedantic warnings
-n select specified case of multiple score
EXIT STATUS
If no error was found, prepmx exits with return code 0. In case of an error, the line number of the processed line is returned. This may
not always be the line containing the actual error. A return status of 10000 means that the input file was empty or could not be opened.
SEE ALSO
M-Tx User's Guide (/usr/share/doc/m-tx/mtxdoc.pdf.gz on a Debian system)
pmx(1), musixtex(1)AUTHORS
prepmx was written by Dirk Laurie <dlaurie@na-net.ornl.gov>. This manual page was written by Roland Stigge <stigge@antcom.de> for the
Debian project. It was revised and extended by Nis Martensen <nis.martensen@web.de>, mostly by copying text from Dirk Laurie's M-Tx User's
Guide.
M-Tx Version 0.60 01 September 2005 prepmx(1)