WriteaCprogramminishell(ms$)thatgoesintoaninfiniteloopwaitingforuser'scommands.Onceacommandisentered,theprogramshouldass...







Write











a












C












program












min









is








hell











(









ms








$








)











that












goes












into












an












infinite












loop












waiting












for












user









's











commands









.











Once












a












command












is












entered









,











the












program












should












assemble












and












execute












each












command












using












fork









(),











exec









()











and












other
























system












calls












as












required












with












the












following












rules












and












conditions









.




















Rule











1









:











The












arg









c











of












any












individual












command












or












program












should












be












>=









1











and
























=









6















































ms









$











ls












-









1











~/









chapter








2











-









S











-









n











//









valid















































ms









$











cat












new









.








txt











//









valid




















Rule











2









:











The












arg









c











of












indu









v








ial











commands












or












programs












that












are












used












along












with












the












special












characters












listed












below












should












be












>=









1











and












<>









6



































Ex









:











ms









$











ls












-









1











~/









chapter








2











-









S











-









n











|












w









c











-









w











//









the











first












command












has












arg









c








=








5











and












the












second












command












has












arg









c








=








2











which












are












used












along












with












the












special












|












character





















Special











Characters





















The











program












should












handle












the












following












special












characters












(









In











accordance












to












Rule












2












and












the












additional












rules












listed












below









)















































|












Pip









ing











(









up











to












5












piping












operations












should












be












supported









)



































Ex












ms









$











cat












ex









1








.








c








|








g








rep











std









|








w








c








|











w









c











-









w



































//
























Every












command









/








program











can












have












arg









c











>=









1











and












<>









6











as












per












Rule












2
















































>









,




















,











>>












Red









irection



































Ex









:











ms









$











ls












-









1











>>









d








isl








ist








.








txt















































&&
























Cond









itional











Execution












//












upt









o











5












conditional












execution












operators












should












be












supported












and












could












possibly












be












a












combination












of












&&












and












||
















































Ex












:












ms









$











ex









1











&&












ex









2











&&












ex









3











&&












ex









4











&&












ex









5















































ms









$











c









1











&&












c









2











||












c









3











&&












c









4















































||
























Cond









itional











Execution












//












see












&&
















































&
























Background












Processing
















































ms









$











ex









1











&












//









should











run












ex









1











in












the












background
















































;
























Sequ









ential











execution












of












commands












(









up











to












5












commands









)











the












arg









c











of












each












command












should












be












>=









1











and












<>









6











as












per












Rule












1




































Ex









:











ms









$











cat












e









1








.








txt








;











cat












e









2








.








txt











;












ls












;












date





















Note








:











You












have












to












use












fork









()











and












exec









()











along












with












other












pertinent












system












calls












to












run












commands












from












min









is








hell





.
Mar 16, 2023
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here