[Pw_forum] Running examples in espresso-4.0

Axel Kohlmeyer akohlmey at cmm.chem.upenn.edu
Mon Jun 23 21:25:47 CEST 2008


On Sun, 22 Jun 2008, Paul M. Grant wrote:

PG> I'm in the middle of a two-day run, but will try Davide's solution when it
PG> finishes.
PG> 
PG> It turns out Ubuntu is a clone of Debian, which is supposed to be "the"
PG> Linux distro, and they use (for some reason), a different command
PG> interpreter, dash (I wonder what the "d" is for ;)).
PG> Where's a good place to park the symlink so that it invokes on boot-up?

paul,

if my understanding is correct, you only need to do it once,
or unless you update "dash" (well maybe not even then). 

i just checked it out (on wikipedia) and it turns out to be 
a renamed version of "ash". redhat used "ash" for a while as 
/bin/sh. the reason being that it is a much smaller executable 
and runs much faster than /bin/bash (even in reduced posix mode).
there also is a (lengthy) explanation on http://wiki.ubuntu.com/DashAsBinSh

since i was using ash previously a lot to detect "bash-isms" in 
shell scripts and to keep them portable, i trust that it actually 
_is_ posix compliant. i checked out the posix specs and indeed
"function" is a "bash-ism" (i've obviously been using bash-only 
systems for too long to forget about this).

i compared with some of my older scripts that passed the "/bin/ash"
acid test and i would like to suggest the attached change.
this should work on any posix compliant shell.


PG> On the subject of command interpreters, I spend a lot of time writing
PG> scripts to generate and analyze text I/O from the PWscf executables, and
PG> bash is tedious, to say the least.  What's been the experience with
PG> "semi-smart" interpreters, like Perl?  How I long for good old APL2, which

perl is great for sifting through tons of text, particularly
if you like using regular expressions. i'm basically writing 
anything that goes beyond simple shell scripts and that does
not warrant writing a compiled executable in perl or - gasp - tcl.
if you can give me a rough description of what you are looking
for and how you'd like the output to be formatted, i may be able 
to whip up some templates that you can adapt to your needs.

if you can find a copy of the old "camel book" (o'reilly book 
on perl describing perl 4) you have a very good, compact and 
quite entertaining introduction to the most important stuff.
the newer edition covering perl 5 is IMO too bloated and the
syntax is basically the same.

a lot of people like to write scripts in python these days, 
but i find that i can do the equivalent stuff in perl with
half the lines of code (and every line of code you don't have
to type is automatically correct... ;-) ).

PG> even has an unconditional goto!  (I actually have IBM's latest on my
PG> machine...maybe I should try it out)

cheers,
   axel.

PG> For anyone interested in superconductivity, I had an N&V in last week's
PG> Nature on the recently discovered "iron age" superconductors...barbs are
PG> welcome.
PG> 
PG> Paul M. Grant, PhD
PG> Principal, W2AGZ Technologies
PG> Visiting Scholar, Applied Physics, Stanford (2005-2008)
PG> EPRI Science Fellow (Retired)
PG> IBM Research Staff Member Emeritus
PG> w2agz at pacbell.net
PG> http://www.w2agz.com
PG>  
PG>  
PG> 
PG> 
PG> -----Original Message-----
PG> From: pw_forum-bounces at pwscf.org [mailto:pw_forum-bounces at pwscf.org] On
PG> Behalf Of Davide Ceresoli
PG> Sent: Sunday, June 22, 2008 2:18 PM
PG> To: Axel Kohlmeyer; PWSCF Forum
PG> Cc: Paul M. Grant
PG> Subject: Re: [Pw_forum] Running examples in espresso-4.0
PG> 
PG> On Sun, 22 Jun 2008, Axel Kohlmeyer wrote:
PG> 
PG> > to the best of my knowledge, the syntax in check_failure.sh is
PG> > correct and the problem is most likely a "feature" in ubuntu.
PG> >
PG> > are you certain that /bin/sh is actually pointing to bash?
PG> >
PG> > unfortunately, there is no good solution. you could make /bin/sh a symlink
PG> to 
PG> > /bin/bash, but that will probably break other scripts, e.g., those that 
PG> > control your startup.
PG> Actually, I'm running Ubuntu 8.04 Hardy and linking /bin/sh to
PG> /bin/bash solves the problem and does not affect the startup
PG> scripts.
PG> 
PG> HTH
PG> 
PG> Davide
PG> 
PG> _______________________________________________
PG> Pw_forum mailing list
PG> Pw_forum at pwscf.org
PG> http://www.democritos.it/mailman/listinfo/pw_forum
PG> 
PG> _______________________________________________
PG> Pw_forum mailing list
PG> Pw_forum at pwscf.org
PG> http://www.democritos.it/mailman/listinfo/pw_forum
PG> 

-- 
=======================================================================
Axel Kohlmeyer   akohlmey at cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qe-posix-sh.diff.gz
Type: application/x-gzip
Size: 1058 bytes
Desc: 
URL: <http://lists.quantum-espresso.org/pipermail/users/attachments/20080623/9511f7ac/attachment.bin>


More information about the users mailing list