Solution 0 4 1: Difference between revisions

From Wiki Max
Jump to navigation Jump to search
m Daniele Varsano moved page Solution 4 1 to Solution 0 4 1
No edit summary
Line 1: Line 1:
* Back to the previous page: [[Scripting#Exercises|Exercises]]
* Back to the previous page: [[Scripting#Output file description:|Output file description]]


Using bash scripting
Using bash scripting

Revision as of 13:01, 2 December 2020

Using bash scripting

#!/bin/bash
#
filein=$1
#
ene=`grep ! $filein | awk '{print $(NF-1)}'`
alat=`grep "lattice parameter" $filein | awk '{print $(NF-1)}'`
#
echo $alat $ene

Probably more elegant and general using awk or (as today's standard) python.