Question: Unix Write a bash script called atom that accepts a PDB file as its only command line argument, if not a PDB file exit with
Unix
Write a bash script called atom that accepts a PDB file as its only command line argument, if not a PDB file exit with an error message. Given a PDB file it will find all lines starting with the word ATOM and for each will display, for each found line, a line output containing the atom's serial number and coordinates. For example a PDB file line looks like this
ATOM 18 CB GLN A 3 83.556 52.126 45.080 1.00 26.06 C
Results in the following output being displayed
18 83.556 52.126 45.080
Because serial number is 18 and the coordinates are 83.556, 52.126, and 45.080. In a PDB file the data is in specific columns. The serial number is always in columns 7 through 11 and the three coordinates start in column 31 and end in column 54. therefore, the bash script has to extract the serial number and coordinates from these columns and display them. The script must check that it has at least one command line argument.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
