Confusion on Cyber Fundamentals Linux CLI ep.16 question 6
Question 6 seems fairly straight forward but I have yet to stumble on the combination of commands the lab is looking for.
The question is "In a single line:
- run sleep 600 to sleep in the background for 10 minutes
- then run touch emptyfile in the foreground to create an empty file."
At first glance it seems to be leading the student to try something like sleep 600 & && touch emptyfile but that's invalid syntax. I've tried ( sleep 600 & ) && touch emptyfile but that doesn't work, I suspect because the && sees the success from the () being executed and immediately runs touch.
I've tried ( sleep 600 && touch emptyfile ) & but after 10 minutes of waiting the lab never "detects" success which I'm guessing because the touch is ran from the background.
I can't find the magic combination to satisfy a sleep command running in the background and then a touch command running in the foreground in a single oneline statement. Any hints would be appreciated, greatly.
Hey EricCulpepper 👋🏻
Welcome to the Human Connection! I'm Chris, I work in the Customer Support Team at Immersive.
I've just had a look at the lab, and you are nearly there with the command you are using to complete Task 6. You are using the right information in the command, but it's more the formatting that isn't quite there.To help, you can remove the brackets (i,e. "()") around the command, it can be typed out as it is in the CLI terminal. Also, you only need a single '&' character to break the commands up.
If you're able to complete the lab with the help I've provided Eric, will you mark this answer as a solution, so we know you've passed the lab?
Kindest regards,
Chris 😊