Trying to connect with remote server and find timestamp of a file but getting invalid command error

sanjoy

New Member
Credits
0
This is my sample code but it's not working getting invalid command error in stat command, the connection is successful but stat command is not working. stat command is installed in both servers local and remote. Thanks in Advance.
#!/bin/bash
host=--
user=--
pass=--

ftp -inv $host <<EOF
user $user $pass
cd /desktop/suman
dst_file="suman.txt"
filetime=$(stat -c %Y "${dst_file}")
echo filetime
bye
EOF
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Top