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

plink, run unix alias

Thread Tools Search this Thread Display Modes
Old Unix and Linux 03-14-2017   -   Original Discussion by Ivanhou8219
Ivanhou8219's Unix or Linux Image
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?

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:

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:

myusername>alias createfile='touch mm'

and I run from plink:

plink.exe -pw mypass myusername@hostip createfile

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

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?


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 07:35 AM.. Reason: Added CODE tags.
Sponsored Links
Old Unix and Linux 03-14-2017   -   Original Discussion by Ivanhou8219
RudiC's Unix or Linux Image
RudiC RudiC is offline Forum Staff  
Join Date: Jul 2012
Last Activity: 20 January 2018, 4:51 PM EST
Location: Aachen, Germany
Posts: 11,962
Thanks: 353
Thanked 3,688 Times in 3,386 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

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 12:51 PM
Where should I install an alias file under UNIX bash ? shub22 OS X (Apple) 1 10-28-2011 09:30 AM
echo in alias for Unix C-Shell Prompt buzzusa Shell Programming and Scripting 3 05-05-2010 12:19 AM
using alias in cygwin unix npatwardhan Shell Programming and Scripting 1 01-18-2009 09:36 AM
Plink connections to multiple unix servers Moxy Shell Programming and Scripting 2 08-28-2008 10:42 PM

All times are GMT -4. The time now is 09:00 PM.