<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Inreractive SCP / File transfer !]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/43409/inreractive-scp-file-transfer?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/43409/inreractive-scp-file-transfer?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/43409/inreractive-scp-file-transfer</guid>
	<pubDate>Tue, 28 Sep 2021 08:14:04 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/43409/inreractive-scp-file-transfer</link>
	<title><![CDATA[Inreractive SCP / File transfer !]]></title>
	<description><![CDATA[<code>#!/bin/bash
#next line prints hearer of script
echo &quot;Interactive Script to Copy File (files) / Directory using scp&quot;
#next line check if entered value is not null, and if null it will reask user to enter Destination Server
while [ x$desthost = &quot;x&quot; ]; do
#next line prints what userd should enter, and stores entered value to variable with name desthost
read -p &quot;Destination Server Name : &quot; desthost
#next line finishes while loop
done
#next line check if entered value is not null, and if null it will reask user to enter Destination Path
while [ x$destpath = &quot;x&quot; ]; do
#next line prints what userd should enter, and stores entered value to variable with name destpath
read -p &quot;Destination Path : &quot; destpath
#next line finishes while loop
done
#next line put null value to variable filename
filename=&#039;null&#039;
#next line check if entered value is null, and If not null it will reask user to enter file(s) to copy
while ! [ x&quot;$filename&quot; = &quot;x&quot; ]; do
#next line prints what userd should enter, and stores entered value to variable with name filename
read -p &quot;Path to source directory / file : &quot; filename
#next line checks if entered value is not null, and if not null it will copy file(s)
if ! [ x&quot;$filename&quot; = &quot;x&quot; ];
then
#next line prints header
echo -n &quot;Copying $filename ... &quot;
#next like copy pre-entered file(s) or dir to destination path on destination server
scp -r &quot;$filename&quot; &quot;$desthost&quot;:&quot;$destpath&quot;
#end of if
fi
#next line finishes while loop
done</code>]]></description>
	<dc:creator>Neel</dc:creator>
</item>

</channel>
</rss>