How to simplify multiple line with same sentence but different inputs using shell command in vi editor

Viewed 22

I'm using Vi editor in linux

Input example:

#!/bin/csh

/nfs/home/disks/allen_13/n13 -oasis /tmp/123/S123/S123.oasis -flow **A**

/nfs/home/disks/allen_13/n13 -oasis /tmp/123/S123/S123.oasis -flow **B**

/nfs/home/disks/allen_13/n13 -oasis /tmp/123/S123/S123.oasis -flow **C**

I'm trying to make it automatically run for those three line because it has its programmable process based on the different inputs (A,B and C) using same line path/same sentences. My question is how do I simplify the same sentences (/nfs/home/disks/allen_13/n13 -oasis /tmp/123/S123/S123.oasis) for line 2 with B input and line 3 for C input into simple line with that can be executed for three lines before. Can you show the full commands or what loop that can be use so that it can be run automatically for three input (A .. B ..C) without changing the sentences (/nfs/home/disks/allen_13/n13 -oasis /tmp/123/S123/S123.oasis). The expectation result is like below.

Expected:

#!/bin/csh

/nfs/home/disks/allen_13/n13 -oasis /tmp/123/S123/S123.oasis -flow **A**,**B**,**C**
0 Answers
Related