Giter Club home page Giter Club logo

ABSTRACT

Problem Statement: The idea is to develop a parser that reads etc/passwd and etc/group and generate a user json containing user id, user full name and groups the user belong

Language Used: Python3 is used for the development

Process: The idea to is to collect the data from each file and use a dictionary, pojo class to store the data. The data then is collected from group file to add it to the groups of the user. During development, different type of exceptions are considered and are implemented in the working code.

Output:

command to run - python parser.py /etc/passwd /etc/group (pass file names as command line argument)

{
	"list": {
		"uid": "38",
		"full_name": "Mailing List Manager",
		"groups": []
	},
	"nobody": {
		"uid": "65534",
		"full_name": "nobody",
		"groups": []
	},
	"lxd": {
		"uid": "106",
		"full_name": "",
		"groups": []
	},
	"ubuntu": {
		"uid": "1000",
		"full_name": "Ubuntu",
		"groups": [
			"adm",
			"cdrom",
			"dip",
			"docker",
			"netdev",
			"plugdev",
			"floppy",
			"dialout",
			"audio",
			"lxd",
			"sudo",
			"video"
		]
	},
	"man": {
		"uid": "6",
		"full_name": "man",
		"groups": []
	}
}

anuragpatro92's Projects

newgrad-2021 icon newgrad-2021

A collection of New Grad full time roles in SWE, Quant, and PM.

wsn-bmac icon wsn-bmac

Automatically exported from code.google.com/p/wsn-bmac

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.