in need to make a loop symbolic link to any file i want on any users i each ..!
i can use this command
awk -F: ' { p="/home/"$1; printf "%s\n%s\n%s\n",p"/public_html/example.php",p"/www/example.html",p"/tmp/example.txt" }' /etc/passwd | sort
but how can make a loop to all users and the output for loop like ?????????:
example.php > /home/user1/public_html/example.php
example.html > /home/user2/www/example.php
example.php > /home/user2/tmp/example.txt
example.php > /home/user3/public_html/example.php
example.php > /home/user3/www/example.html
example.php > /home/user3/tmp/example.txt
[...snip...]
And I mean that the way .. The work is repeated or test paths for the selected files above And the creation a symbolic link for all rights files in each path by using the command
ln -s
i try to Executable the commands
#/bin/bash
mkdir folder
a=awk -F: ' { p="/home/"$1; printf "%s\n%s\n%s\n",p"/public_html/example.php",p"/www/example.html",p"/tmp/example.txt" }' /etc/passwd | sort
ln -s "$a" > folder
done
But it fails
and i wait your answer ,,,thank you stackoverflow.com