Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 601 Bytes

File metadata and controls

28 lines (22 loc) · 601 Bytes

Problem 3: Execute Command

Problem Statement: Create a function executeCommand(command) that takes a shell command as input and executes it using the child_process module. The function should print the output of the command to the console.

Function Signature:

function executeCommand(command) {
    // Implementation
}

Expected Output:

Command Output:
File1.txt
File2.txt

Test Cases:

executeCommand('ls -la');
// Expected Output: (output of ls -la)

executeCommand('echo "Hello, Node.js!"');
// Expected Output: Hello, Node.js!