Skip to content
Advertisement

get user input in awk script and update it in file

I have a students.txt (RollNo, Name, IDU, CGPA), If Roll number exists prompt the user to change the IDU and CGPA and update the same in the file named “Student.txt”

I made the following script:

JavaScript

now I need help in taking user input for IDU and CGPA values and update the students.text file with that values against the record found.

Advertisement

Answer

first, I grep for roll

JavaScript

if found then used awk to replace the records

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement