Wondering if somebody can help me with grep or awk. I have 2 files, the first one contains students IDs and a second that contains config files that relates to each student
File 1 (oldstudent.txt)
5678D956
45S87954
56898K78
4D856898
556987F8
23657D87
File 2 (app_path.config)
/export/home/5678D956/Scripts
/export/home/5678D956/FTP
/export/home/5678D956/HomeDirs
/export/home/4487984D/Scripts
/export/home/4487984D/FTP
/export/home/4487984D/HomeDirs
/export/home/45S87954/Scripts
/export/home/45S87954/FTP
/export/home/45S87954/HomeDirs
/export/home/56898K78/Scripts
/export/home/56898K78/FTP
/export/home/56898K78/HomeDirs
/export/home/909878S4/Scripts
/export/home/909878S4/FTP
/export/home/909878S4/HomeDirs
I would like to have it so that if a student exists in File 1, it comments out their configuration setting and saves as File 3 (app_path_new.config)
#/export/home/5678D956/Scripts
#/export/home/5678D956/FTP
#/export/home/5678D956/HomeDirs
/export/home/4487984D/Scripts
/export/home/4487984D/FTP
/export/home/4487984D/HomeDirs
#/export/home/45S87954/Scripts
#/export/home/45S87954/FTP
#/export/home/45S87954/HomeDirs
#/export/home/56898K78/Scripts
#/export/home/56898K78/FTP
#/export/home/56898K78/HomeDirs
/export/home/909878S4/Scripts
/export/home/909878S4/FTP
/export/home/909878S4/HomeDirs
I have been trying with grep, sed and awk, and don't seem to be going anywhere.
Thanks