I'm having trouble with my bash script.
My script lists all files ending with .txt inThe selection should be based on submitting an argument when the folder where my script is. Can I for example have
ls -l
as one argument and make
| grep .txt > files_in_folder
as a second argument and then string them together? If so, how?
I really can't figure this out myself and I am probably the biggest noob ever existed :D. It's part of an assignment my beginners course in IT-development executed.
#!/bin/bash
#This script echoes a text and creates a file
echo "welcome. Will create a file with content in this folder"
ls -l | grep .txt > files_in_folder