Bitcoin Forum
November 14, 2024, 03:29:37 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Remotely uploading and executing Bash scripts (BAMT)  (Read 1470 times)
superfastkyle (OP)
Sr. Member
****
Offline Offline

Activity: 437
Merit: 250


View Profile
March 16, 2013, 05:17:17 AM
 #1

Need some help uploading a bash file from my Windows computer to my BAMT mining rigs.  I really don't know how to use the file transfer thing on ssh so I've been using wget and dropbox as a go between. This works fine for uploading bamt.conf files. But when I upload bash files I get this message on execution "-bash: /bin/updatecg: /bin/bash^M: bad interpreter: No such file or directory" This happens I believe because when I try to edit it with nano the file says converted from dos format. I am using notepad++ on windows and saving it with the unix batch file option but still it must be formatted incorrectly. Can anyone help. All the commands appear to me perfect when viewing in nano. I can copy and paste the commands directly in a new file and the script works fine.
kingcoin
Sr. Member
****
Offline Offline

Activity: 262
Merit: 250


View Profile
March 16, 2013, 01:39:47 PM
 #2

"-bash: /bin/updatecg: /bin/bash^M

Don't know anything about BAMT, but

It seems like you have a carrage return in there. So it's trying to run a shell called /bin/bash<carriage-return>. Linux files are line feed terminated. Windows uses carriage-return line-feed. Make sure you remove all carriage returns before you execute the file.
01BTC10
VIP
Hero Member
*
Offline Offline

Activity: 756
Merit: 503



View Profile
March 16, 2013, 01:56:22 PM
 #3

To transfer a file via SSH use scp.

http://manpages.ubuntu.com/manpages/lucid/man1/scp.1.html

If you want to transfer file "test1.txt" in home folder of user1 at computer1(you can put IP address here) to current folder type:

Code:
$ scp user1@computer1:~/test1.txt .

Notice the dot at the end. It means you want to copy the file in the same folder you are actually doing the command. You can also use a path like ~/folder/AnotherFileName.txt instead.
superfastkyle (OP)
Sr. Member
****
Offline Offline

Activity: 437
Merit: 250


View Profile
March 18, 2013, 03:36:40 AM
 #4

Well I found out the problem. I was using notepad++ which although doesn't do the spaces like a default windows notepad does still does the line return windows way (with default settings). Basically it worked for bamt.conf and pools file but no other files. I guess bamt must ignore the carrier returns. So if you use notepad plus you can "Edit: EOL Conversion: Unix format" and resave and it worked
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!