I want to perform an operation where I am passing a file ( let's name it X ) in the "while loop" in an ssh command.
For an example:
ssh -n root@host "<<here I want to fit in my below while loop>>"
while read line
do
cd $line
cp file1 /location2/
done < X.txt
I hope you understand that I want a single line while loop here in my ssh command.
Please help me out.