Unix/Linux Go Back    


Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

How to run UNIX alias from plink?

Windows & DOS: Issues & Discussions


Tags
plink, run unix alias

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 03-14-2017
Ivanhou8219 Ivanhou8219 is offline
Registered User
 
Join Date: Mar 2017
Last Activity: 14 March 2017, 6:05 AM EDT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
How to run UNIX alias from plink?

Hi,
I am new to unix and plink in general. I want to run plink.exe on windows to execute alias command on unix. Is it possible? I can run simple unix commands from plink for ex:

Code:
plink.exe -pw mypass myusername@hostip touch filename

It successfully creates the "filename" file on the hostip host.
But if I create an alias for it:

Code:
myusername>alias createfile='touch mm'

and I run from plink:

Code:
plink.exe -pw mypass myusername@hostip createfile

it returns: ksh: createfile: not found
I tried also:

Code:
plink.exe -pw mypass myusername@hostip -s createfile

result was: FATAL ERROR: Server refused to start a shell/command

So how can I run alias commands within plink?

Thanks,
Ivanhou



Moderator's Comments:
How to run UNIX alias from plink? Please use CODE tags as required by forum rules!

Last edited by RudiC; 03-14-2017 at 06:35 AM.. Reason: Added CODE tags.
Sponsored Links
    #2  
Old Unix and Linux 03-14-2017
RudiC RudiC is online now Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 26 April 2017, 7:31 AM EDT
Location: Aachen, Germany
Posts: 10,686
Thanks: 263
Thanked 3,283 Times in 3,024 Posts
An alias is usually created and persists only in an interactive session, so it is lost between sessions. If you dont wan't to define it manually every time you log in, put it into one of the login scripts (e.g. .profile) on the target host to use it as you post above.
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
look up Unix server alias name abbya UNIX for Dummies Questions & Answers 3 07-18-2012 11:51 AM
Where should I install an alias file under UNIX bash ? shub22 OS X (Apple) 1 10-28-2011 08:30 AM
echo in alias for Unix C-Shell Prompt buzzusa Shell Programming and Scripting 3 05-04-2010 11:19 PM
using alias in cygwin unix npatwardhan Shell Programming and Scripting 1 01-18-2009 08:36 AM
Plink connections to multiple unix servers Moxy Shell Programming and Scripting 2 08-28-2008 09:42 PM



All times are GMT -4. The time now is 07:40 AM.