Bash. Problem writing a script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Andrey53
    New Member
    • Jan 2020
    • 1

    Bash. Problem writing a script

    Hello, I'm a beginner in programming and I'm having trouble writing a script.
    Write a script with two parameters: file name mask and directory name.
    The script's task is to display a list of file names from the given directory, matching the given mask together with the name of the owner and his UID number
    I am asking for advice on the execution of the script.
    Regards. :)

    Code:
    ! # / Bin / bash
    find "$ 1" -name "*. $ 2" -exec stat -c "% N% u% U" '{}' \;
    Last edited by gits; Jan 20 '20, 08:01 AM. Reason: added code tags
  • SioSio
    Contributor
    • Dec 2019
    • 272

    #2
    Code:
    #!/bin/bash
    find $1 -name *.$2 -exec stat -c "%N%u%U" {} \;

    Comment

    Working...