Convert .sh file into .exe file | Unix Linux Forums | UNIX and Linux Applications

  Go Back    


UNIX and Linux Applications Discuss UNIX and Linux software applications. This includes SQL, Databases, Middleware, MOM, SOA, EDA, CEP, BI, BPM and similar topics.

Convert .sh file into .exe file

UNIX and Linux Applications


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-23-2012
Dhanashree Dhanashree is offline
Registered User
 
Join Date: Sep 2012
Last Activity: 26 September 2012, 8:41 AM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Convert .sh file into .exe file

Currently im using putty to execute .sh file.
This file is currently saved onto a server.
The .sh file tries to get files from other server and load the files into the current server.

Now i want this .sh file to run as an .exe file on my desktop.
So that by just double clicking the file and by giving the server's username and password, the file can be executed.

Is this possible to do????
Sponsored Links
    #2  
Old 09-23-2012
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 30 October 2014, 1:31 PM EDT
Location: Saskatchewan
Posts: 19,732
Thanks: 830
Thanked 3,372 Times in 3,159 Posts
Since you say .exe, I'm assuming you use Windows.

You can create a batch file which uses plink to do so. It's just like putty except non-graphical, designed to be automated.
Sponsored Links
    #3  
Old 09-26-2012
Dhanashree Dhanashree is offline
Registered User
 
Join Date: Sep 2012
Last Activity: 26 September 2012, 8:41 AM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,
bat file works for any cmd commands.
but in my case i have to connect to servers to get the data.
and i connect to the server using putty.

so if you can tell me how to make bat file that can connect to any server and get data and execute commands.
    #4  
Old 09-26-2012
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 30 October 2014, 1:31 PM EDT
Location: Saskatchewan
Posts: 19,732
Thanks: 830
Thanked 3,372 Times in 3,159 Posts
PUTTY is graphical. It cannot be automated that way. You could do it on the server side, perhaps -- preparing a special account for putty to log into, complete with ssh keys so putty can login passwordless, whose profile goes direct to the scripts you wish to run, etc. Double-clicking on the right profile would put you straight in.

If you cannot do that and must script it on the client side, that's why the same project which made putty also made the plink utility, which can be automated.


Code:
C:\Documents and Settings\User>plink
PuTTY Link: command-line connection utility
Release 0.61
Usage: plink [options] [user@]host [command]
       ("host" can also be a PuTTY saved session name)
Options:
  -V        print version information and exit
  -pgpfp    print PGP key fingerprints and exit
  -v        show verbose messages
  -load sessname  Load settings from saved session
  -ssh -telnet -rlogin -raw -serial
            force use of a particular protocol
  -P port   connect to specified port
  -l user   connect with specified username
  -batch    disable all interactive prompts
The following options only apply to SSH connections:
  -pw passw login with specified password
  -D[listen-IP:]listen-port
            Dynamic SOCKS-based port forwarding
  -L[listen-IP:]listen-port:host:port
            Forward local port to remote address
  -R[listen-IP:]listen-port:host:port
            Forward remote port to local address
  -X -x     enable / disable X11 forwarding
  -A -a     enable / disable agent forwarding
  -t -T     enable / disable pty allocation
  -1 -2     force use of particular protocol version
  -4 -6     force use of IPv4 or IPv6
  -C        enable compression
  -i key    private key file for authentication
  -noagent  disable use of Pageant
  -agent    enable use of Pageant
  -m file   read remote command(s) from file
  -s        remote command is an SSH subsystem (SSH-2 only)
  -N        don't start a shell/command (SSH-2 only)
  -nc host:port
            open tunnel in place of session (SSH-2 only)
  -sercfg configuration-string (e.g. 19200,8,n,1,X)
            Specify the serial configuration (serial only)

C:\Documents and Settings\Username>type test.txt
echo "Hello World"
hostname

C:\Documents and Settings\User> plink.exe -batch -m test.txt -pw mypassword User@hostname
Hello World
mecgentoo

C:\Documents and Settings\User>


Last edited by Corona688; 09-26-2012 at 11:24 AM..
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Convert CSV file (with double quoted strings) to pipe delimited file Ram.Math Shell Programming and Scripting 8 08-26-2011 07:15 AM
PERL:How to convert numeric values txt file to PACKED DECIMAL File? aloktiwary Shell Programming and Scripting 1 05-20-2009 09:55 AM
Convert CSV file (with double quoted strings) to pipe delimited file lehmanbrothers Shell Programming and Scripting 11 02-13-2009 12:14 PM
convert one colume file to a one line, wrapped file. jouuu UNIX for Advanced & Expert Users 7 12-03-2008 05:07 AM
Plz Help To convert xml file to text file using bourn shell scripts ram2s2001 Shell Programming and Scripting 0 11-09-2005 08:56 AM



All times are GMT -4. The time now is 02:11 PM.