also on startup I want to pass the folder path when placing these .sh files
I started with this
#!/bin/bash find /home/user_name -name "*.sh"
And after the script has to write to the list of logos with executables
By searching directly (I've fixed - this is the safest and preferred option - see comments below):
find /home/user -name "*.sh" -execdir chmod u+x {} +
If you want to make all files executable for the current user, you can use the command as follows (assuming you have permission to all files in the target home folder):
find /home/user_name -name "*.sh" -print0 | xargs -0 chmod u+x
another way:
find . -name "*.sh" -exec chmod ux+y {} \;
you can check your command first using
find . -name "*.sh" -print
By @kabanus command
#!/bin/bash # chmod u+x $(find $1 -name "*.sh") # ls -1 $1/*.sh find $1 -name "*.sh" -print -exec chmod u+x {} +
And use like
$ ./script.sh /your_directory
/your_directory is the first argument ( $1 ) in the script.
/your_directory
$1