Sending & Receiving Binary Files Via Bash On Linux
Page 1 of 1
Sending & Receiving Binary Files Via Bash On Linux
Sending & Receiving Binary Files Via Bash On Linux
There will be 1 video and on the video it is in 2 parts (no markings)
The 1st part is for sending image.gif
the second part is project called anyfile so you can send files other than image.gif (feel free to modify the script)!
There will be 4 sets of code, one for server and 1 for client for each part as explained above
for sending image.gif client
Server for above
There will be 1 video and on the video it is in 2 parts (no markings)
The 1st part is for sending image.gif
the second part is project called anyfile so you can send files other than image.gif (feel free to modify the script)!
There will be 4 sets of code, one for server and 1 for client for each part as explained above
for sending image.gif client
- Code:
#!/bin/bash
# (c) J~NET
# Usage: ./nc_client.sh
clear
echo "Binary Client Reciever"
echo -en "\e[92mPlease Wait \c"
sudo nc -l -p 777 > newimage.gif
count=0
total=34
pstr="[=======================================================================]"
while [ $count -lt $total ]; do
sleep 0.06 # this is work
count=$(( $count + 1 ))
pd=$(( $count * 73 / $total ))
printf "\r%3d.%1d%% %.${pd}s" $(( $count * 100 / $total )) $(( ($count * 1000 / $total) % 10 )) $pstr
done
echo "All Done!"
Server for above
- Code:
#!/bin/bash
# (c) J~NET
# Usage: ./nc_server.sh
clear
echo "Binary Server AKA SENDER"
clear
echo -en "\e[92mPlease Wait \c"
sudo cat image.gif | nc localhost 777
count=0
total=34
pstr="[=======================================================================]"
while [ $count -lt $total ]; do
sleep 0.06 # this is work
count=$(( $count + 1 ))
pd=$(( $count * 73 / $total ))
printf "\r%3d.%1d%% %.${pd}s" $(( $count * 100 / $total )) $(( ($count * 1000 / $total) % 10 )) $pstr
done
echo "File Sent!"
Re: Sending & Receiving Binary Files Via Bash On Linux
For any file Sending (the client side wont know the extension so resolving that will be be coming soon!
Client side for anyfile sending
Server
Client side for anyfile sending
- Code:
#!/bin/bash
# (c) J~NET
#
clear
echo "Binary Client Reciever"
echo -en "\e[92mPlease Wait \c"
sudo nc -l -p 777 > output
count=0
total=34
pstr="[=======================================================================]"
while [ $count -lt $total ]; do
sleep 0.06 # this is work
count=$(( $count + 1 ))
pd=$(( $count * 73 / $total ))
printf "\r%3d.%1d%% %.${pd}s" $(( $count * 100 / $total )) $(( ($count * 1000 / $total) % 10 )) $pstr
done
echo "All Done!"
Server
- Code:
#!/bin/bash
# (c) J~NET
#
# Usage: ./nc_server.sh "file.ext"
myvar="$@"
clear
echo "Binary Server AKA SENDER"
clear
echo -en "\e[92mPlease Wait \c"
sudo cat $myvar | nc localhost 777
count=0
total=34
pstr="[=======================================================================]"
while [ $count -lt $total ]; do
sleep 0.06 # this is work
count=$(( $count + 1 ))
pd=$(( $count * 73 / $total ))
printf "\r%3d.%1d%% %.${pd}s" $(( $count * 100 / $total )) $(( ($count * 1000 / $total) % 10 )) $pstr
done
echo "File Sent!"
Re: Sending & Receiving Binary Files Via Bash On Linux
Check Out Sending Messages Via Netcat & Bash Link
jnet.forumotion.com/t1326-messeging-with-netcat-script-with-bash-on-linux#1848
jnet.forumotion.com/t1326-messeging-with-netcat-script-with-bash-on-linux#1848
Re: Sending & Receiving Binary Files Via Bash On Linux
2018 Edition now includes more file types and improved code
J~Net 2018
File Sending Kit For Linux Bash Using Netcat
Box Update Link
app.box.com/s/1zs6gtgs2zbt4rpjem8vesq1i3kxigo2
Forum Link
https://jnet.forumotion.com/t1325-sending-receiving-binary-files-via-bash-on-linux?highlight=sending+file+with+netcat
J~Net 2018
File Sending Kit For Linux Bash Using Netcat
Box Update Link
app.box.com/s/1zs6gtgs2zbt4rpjem8vesq1i3kxigo2
Forum Link
https://jnet.forumotion.com/t1325-sending-receiving-binary-files-via-bash-on-linux?highlight=sending+file+with+netcat
Similar topics
» Setting up bluetooth for linux for sending files over BT
» Raspberry Pi Email Tutorial Sending & Receiving with SendGrid
» FTP Files From Linux With Bash
» Converting Doc & Docx To PDF Files On Linux With Bash
» Mass Rename Files In Linux Using Bash
» Raspberry Pi Email Tutorial Sending & Receiving with SendGrid
» FTP Files From Linux With Bash
» Converting Doc & Docx To PDF Files On Linux With Bash
» Mass Rename Files In Linux Using Bash
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum