This led to an error "Syntax error: "(" unexpected" on my ubuntu,
I executed it in a script started with: ---------- Post updated at 07:27 PM ---------- Previous update was at 07:19 PM ----------
Quote:
Originally Posted by gary_w
This led to an error "Illegal option -A" on my ubuntu,
I execute it in a script started with:
Maybe it is related to the mismatch of the syntax and the shell version on my machine.
Hi,
Is there any way to convert a string into an array in KSH? In other words I want to split the string like this:
STRING="one two three four"
into an array of 4 values splitting on white space. The array should be similar to the one that would be created with the following command:
... (3 Replies)
I need to split a long varible which is a whole line read from a file into fields and store them in an array, the fields are delimited by pipe and a field may contain white spaces.
I tried the following concept test and it has problem with field 5 which contain a space, appearently so because... (3 Replies)
Hi all,
I have a file of around 300 lines in which string "SERVER" occurs around 32 times.
for eg.
I need to split files like, for eg
I am using this code
awk '/SERVER/{n++}{print > f n}' f=/vikas/list /vikas/final
But the problem is that it makes maximum of 10 files, but I... (12 Replies)
Hi,
How do I parse/split lines (strings) read from a file and display the individual tokens in a shell script? Given that the length of individual lines is not constant and number of tokens in each line is also not constant.
The input file could be as below:
... (3 Replies)
i need one help....
if i have a string like aaaaa,bbbbb,ccccc,aaaaa
How to to split the string and check howmany times aaaaa will be in that string?
Thanks (7 Replies)
Hi all,
I want to create an array variable in shell, for example:
#!/bin/sh
name="foo"
name="bar"
name="baz"
But above code didn't work, I also tried with:
name=(foo bar baz)
and
set -A name foo bar baz
but none of these worked.
Another question is how to know the shell... (6 Replies)
Hello,
I was trying to split a string to characters by perl oneliner.
echo "The quick brown fox jumps over the lazy dog" | perl -e 'split // ' But did not work as with bash script pipe:
echo "The quick brown fox jumps over the lazy dog" | fold -w1 | sort | uniq -ic 8
1 T
1... (6 Replies)
Hi
Input:
{ committed = 782958592; init = 805306368; max = 1051394048; used = 63456712; }
Result:
A map (maybe Associative Array) where I can iterate through the key/value. Something like this:
for key in $map
do
echo key=$key value=$map
done
Sample output from the map:
... (2 Replies)
value=malayalam
# i need to store the value in an array by splitting the character
#the output i need is
m
a
l
a
y
a
l
a
m
Please use CODE tags for output data as well as required by forum rules! (5 Replies)
Test1.txt
Tom is hot
Test.sh
filename="/directory/Test1.txt"
set - A store
while IFS= read value
do
awk '{split($value,store," ")}'
done < "$filename"
echo ${#sore}
From the code in the executing file, I would like each... (8 Replies)
Discussion started by: TestKing
8 Replies
LEARN ABOUT DEBIAN
mpb-split
MPB(1) MIT Photonic-Bands Package MPB(1)NAME
mpb-split - compute eigenmodes with MPB using multiple processes
SYNOPSIS
mpb-split NUM-SPLIT [DEFINITION]... [CTLFILE]...
DESCRIPTION
mpb-split is a parallelizing front-end to MIT Photonic Bands (MPB). For a computation with several k points, it splits the list of k
points over multiple processes. Of course, this will only benefit you on a system where different processes will run on different proces-
sors, such as an SMP or a cluster with automatic process migration (e.g. MOSIX). mpb-split is actually a trivial shell script, though, so
you can easily modify it if you need to use a special command to launch processes on other processors/machines.
MIT Photonic Bands (MPB) is a free program to compute the band structures (dispersion relations) and electromagnetic modes of periodic
dielectric structures, and is applicable both to photonic crystals (photonic band-gap materials) and a wide range of other optical prob-
lems.
More information on MPB, including a detailed manual, can be found online at the MPB home page: http://ab-initio.mit.edu/mpb/
A typical invocation of mpb-split looks like:
mpb-split num-split foo.ctl >& foo.out
This causes mpb-split to process the control file foo.ctl, divide the k points into num-split equal chunks, run each list in a separate
process with MPB, and redirect the output (in order) to foo.out. (One typically redirects output to a file, as the output is verbose and
contains a number of comma-delimited datasets that one can extract by grepping.)
Overall, the behavior and arguments are the same as for mpb except that the first argument must be the integer num-split.
What mpb-split technically does is to set the MPB variable k-split-num to num-split and k-split-index to the index (starting with 0) of the
chunk for each process. If you want, you can use these variables to divide the problem in some other way and then reset them to 1 and 0,
respectively.
BUGS
Send bug reports to S. G. Johnson, stevenj@alum.mit.edu.
AUTHORS
Written by Steven G. Johnson. Copyright (c) 1999, 2000, 2001, 2002 by the Massachusetts Institute of Technology.
SEE ALSO mpb(1), mpb-data(1)MPB March 13, 2002 MPB(1)