I need a script that would be similar to the ls and dir commands. To display information about the needed directory.
#!/bin/bash
for entry in *
do
echo "$entry"
done
But this script outputs files only in the directory where the script is located. How do I make the output in the directory that I need?
CodePudding user response:
you can accept args with $1
, etc. and refer to them later
for file in "$1"; do