{"id":429,"date":"2026-02-17T04:40:41","date_gmt":"2026-02-17T04:40:41","guid":{"rendered":"https:\/\/mitalgoswami.in\/?p=429"},"modified":"2026-02-17T04:44:01","modified_gmt":"2026-02-17T04:44:01","slug":"student-record-mini-project-menu-driven-shell-script","status":"publish","type":"post","link":"https:\/\/mitalgoswami.in\/?p=429","title":{"rendered":"Student Record Mini Project (Menu-Driven Shell Script)"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">This mini project stores student data in a file (<code>students.txt<\/code>) and provides options to:<\/h1>\n\n\n\n<p><\/p>\n\n\n\n<p>1&#xfe0f;&#x20e3; Add Record<br>2&#xfe0f;&#x20e3; View All Records<br>3&#xfe0f;&#x20e3; Search Record<br>4&#xfe0f;&#x20e3; Delete Record<br>5&#xfe0f;&#x20e3; Update Record<br>6&#xfe0f;&#x20e3; Exit<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">&#x1f5c2;&#xfe0f; Data Format (students.txt)<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>RollNo|Name|Marks\n101|Rahul|85\n102|Amit|90\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">&#x1f5a5;&#xfe0f; Script: <code>student_record.sh<\/code><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\nfile=\"students.txt\"\n\ntouch $file\n\nwhile true\ndo\n    echo \"-----------------------------\"\n    echo \"1. Add Student Record\"\n    echo \"2. View All Records\"\n    echo \"3. Search Student by Roll No\"\n    echo \"4. Delete Student Record\"\n    echo \"5. Update Student Marks\"\n    echo \"6. Exit\"\n    echo \"Enter your choice:\"\n    read choice\n\n    case $choice in\n\n    1)\n        echo \"Enter Roll No:\"\n        read roll\n        echo \"Enter Name:\"\n        read name\n        echo \"Enter Marks:\"\n        read marks\n        echo \"$roll|$name|$marks\" &gt;&gt; $file\n        echo \"Record added successfully.\"\n        ;;\n\n    2)\n        echo \"Student Records:\"\n        cat $file\n        ;;\n\n    3)\n        echo \"Enter Roll No to search:\"\n        read roll\n        grep \"^$roll|\" $file\n        ;;\n\n    4)\n        echo \"Enter Roll No to delete:\"\n        read roll\n        grep -v \"^$roll|\" $file &gt; temp.txt\n        mv temp.txt $file\n        echo \"Record deleted successfully.\"\n        ;;\n\n    5)\n        echo \"Enter Roll No to update marks:\"\n        read roll\n        echo \"Enter new marks:\"\n        read newmarks\n        grep -v \"^$roll|\" $file &gt; temp.txt\n        echo \"$roll|UpdatedName|$newmarks\" &gt;&gt; temp.txt\n        mv temp.txt $file\n        echo \"Record updated successfully.\"\n        ;;\n\n    6)\n        echo \"Exiting program...\"\n        break\n        ;;\n\n    *)\n        echo \"Invalid choice!\"\n        ;;\n\n    esac\ndone\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">&#x2705; How to Run<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x student_record.sh\n.\/student_record.sh\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">&#x1f3af; Sample Output<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>1. Add Student Record\n2. View All Records\n3. Search Student by Roll No\n4. Delete Student Record\n5. Update Student Marks\n6. Exit\nEnter your choice: 1\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">&#x1f525; Commands Used (Viva Important)<\/h1>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>touch<\/code> \u2192 create file<\/li>\n\n\n\n<li><code>cat<\/code> \u2192 display records<\/li>\n\n\n\n<li><code>grep<\/code> \u2192 search record<\/li>\n\n\n\n<li><code>grep -v<\/code> \u2192 delete record<\/li>\n\n\n\n<li><code>mv<\/code> \u2192 replace file<\/li>\n\n\n\n<li><code>>><\/code> \u2192 append data<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This mini project stores student data in a file (students.txt) and provides options to: 1&#xfe0f;&#x20e3; Add Record2&#xfe0f;&#x20e3; View All Records3&#xfe0f;&#x20e3; Search Record4&#xfe0f;&#x20e3; Delete Record5&#xfe0f;&#x20e3; Update Record6&#xfe0f;&#x20e3; Exit &#x1f5c2;&#xfe0f; Data Format (students.txt) &#x1f5a5;&#xfe0f; Script: student_record.sh &#x2705; How to Run &#x1f3af; Sample Output &#x1f525; Commands Used (Viva Important)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-429","post","type-post","status-publish","format-standard","hentry","category-unix"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/posts\/429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=429"}],"version-history":[{"count":1,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/posts\/429\/revisions"}],"predecessor-version":[{"id":430,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/posts\/429\/revisions\/430"}],"wp:attachment":[{"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}