Skip to content

Instantly share code, notes, and snippets.

View Wadkar07's full-sized avatar

Shubham Wadkar Wadkar07

View GitHub Profile
@Wadkar07
Wadkar07 / problem1.cjs
Last active February 17, 2023 08:29
Problem_1
// ==== Problem #1 ====
// The dealer can't recall the information for a car with an id of 33 on his lot. Help the dealer find out which car has an id of 33 by calling a function that will return the data for that car. Then log the car's year, make, and model in the console log in the format of:
// "Car 33 is a *car year goes here* *car make goes here* *car model goes here*"
const inventory = require('./cars.cjs')
function getCarWithId(inventoryData,id){
let car =[];
if(inventoryData === undefined || id === undefined || typeof inventoryData !== 'object' ||typeof id !== 'number'||!Array.isArray(inventoryData)||inventoryData.length === 0) {
return car;
@Wadkar07
Wadkar07 / Command_drill_intermediate.sh
Last active February 9, 2023 09:36
Command_drill_II
#######
#Pipes#
#######
#Download the contents of "Harry Potter and the Goblet of fire" using the command line
wget https://raw.githubusercontent.com/bobdeng/owlreader/master/ERead/assets/books/Harry%20Potter%20and%20the%20Goblet%20of%20Fire.txt
#Print the first three lines in the book
#using awk
cat "Harry Potter and the Goblet of Fire.txt" | awk 'FNR==1,FNR==3'
@Wadkar07
Wadkar07 / Command_drill_I.sh
Last active February 8, 2023 09:21
Command_drill
#! /usr/bin/bash
# Creating_directory_structure
mkdir -p hello/{one/two/three/four,five/six/seven}
touch hello/five/six/c.txt hello/five/six/seven/error.log hello/five/six/seven/error.log hello/one/{a.txt,b.txt} hello/one/two/d.txt hello/one/two/three/e.txt hello/one/two/three/four/access.log
# Delete all the files having the .log extension
find . -name '*.log' -delete
echo Deleting file with the .log extension