{"id":27443080,"url":"https://github.com/mansi-k/ssd_assignment1","last_synced_at":"2025-04-15T01:19:02.569Z","repository":{"id":207186869,"uuid":"320922243","full_name":"mansi-k/SSD_Assignment1","owner":"mansi-k","description":"Assignment 1 for the course Software Systems Development @ IIITH","archived":false,"fork":false,"pushed_at":"2020-12-13T06:48:07.000Z","size":468,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T01:18:46.567Z","etag":null,"topics":["file-operations","linux-commands"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mansi-k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-12-12T20:55:09.000Z","updated_at":"2021-10-08T19:04:55.000Z","dependencies_parsed_at":"2023-11-14T14:55:58.595Z","dependency_job_id":null,"html_url":"https://github.com/mansi-k/SSD_Assignment1","commit_stats":null,"previous_names":["mansi-k/ssd_assignment1"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mansi-k%2FSSD_Assignment1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mansi-k%2FSSD_Assignment1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mansi-k%2FSSD_Assignment1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mansi-k%2FSSD_Assignment1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mansi-k","download_url":"https://codeload.github.com/mansi-k/SSD_Assignment1/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986316,"owners_count":21194025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file-operations","linux-commands"],"created_at":"2025-04-15T01:19:02.017Z","updated_at":"2025-04-15T01:19:02.562Z","avatar_url":"https://github.com/mansi-k.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ASSIGNMENT 1\r\n\r\n## Question 1\r\nc) Assumed there is `no other .txt file` than those told to create (5 lab.txt files).\r\nd) `Current directory : Assignment1`. Used `-A` option to list all files (excluding .. and .). I displayed `sizes in bytes` (default). If human readable size format is needed, add -h.\r\ne) Assumed that `only full path` of the files and folders have to be displayed and not any other properties.\r\nf) In sub-question (a), it was told to cd into `Assignment1 folder`, thus assuming it to be the current directory I used `$PWD` in the command.\r\n\r\n## Question 2\r\nRead input from user (not commandline arg).\r\nAssumed that the `entire word` of the input should form a command.\r\nExample: `rpeg == grep` but `arpegbm != grep`.\r\nThe input can include whitespaces, it will be treated as 1 word.\r\n\r\n## Question 3\r\nRead input from user (not commandline arg).\r\nI diplayed the command and its count in the `descending order of the number of times it is used`. The command used maximum number of times is displayed above.\r\nI have `used bash_history file` for this, but it stores history till the `last session`. \r\nNeither history command was working nor was append history command working inside the bash script. This is because `history commands are by default disabled in non-interactive scripts`. \r\nI observed that by `removing the shebang line, the history command works inside the script`, but as I was not sure in which environment testing would be done, I did not prefer removing it. But i am writing down the command for that:\r\n`history | awk '{print $2;}' | sort | uniq -c | sort -r | awk '{print $2 \" \" $1}'`\r\n\r\n## Question 4\r\nRead input from user (not commandline arg).\r\nAs mentioned in the discussion, if the input is 1 2 3 4 the output will be (1 2 3 4)\r\n\r\n## Question 5\r\nRead input from user (not commandline arg).\r\nInput can contain spaces.\r\n\r\n## Question 6\r\nTook command line arguments as input.\r\n\r\n## Question 7\r\nRead input from user (not commandline arg).\r\n`Removed header` and then `stored only PIDs` of all processes in pid.txt\r\n\r\n## Question 8\r\nTook the crontab file path as command line argument.\r\nTried installing the crontab job. If its exit status is 0 then printed Yes, else printed No.\r\nRedirected the crontab output/error (if any) to /dev/null\r\n\r\n## Question 9\r\nRead input from user (not commandline arg).\r\n`Assumptions:`\r\n`Valid cases:` string of digits (including spaces), string length \u003e 1, after doing the given operations the total%10 should be 0\r\n`Invalid cases:` string length \u003c= 1, any other character than 0-9 (excluding space), after doing the given operations the total%10 != 0\r\n\r\n## Question 10\r\nRead all inputs from user (not commandline arg).\r\nOnly in the case of `division`, used `floating point` operation upto 4 precesion. Ie, 16.0000 will be printed instead of 16\r\nFor other operations `(+, *, -)`, used normal arithmetic so their answers will `never have decimal point`.\r\n\r\n\r\n\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmansi-k%2Fssd_assignment1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmansi-k%2Fssd_assignment1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmansi-k%2Fssd_assignment1/lists"}