Sponsored Content
Special Forums Windows & DOS: Issues & Discussions How to run UNIX alias from plink? Post 302993753 by Ivanhou8219 on Tuesday 14th of March 2017 05:59:12 AM
Old 03-14-2017
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:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 03-14-2017 at 07:35 AM.. Reason: Added CODE tags.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

unix question: user supplied input for 'alias'

I have a program to scan the log files and I want to pipe the output to 'less'. I want to create an alias such that following are equivalent scanlog chunky.lst = /udd/n2man/utils/scanlog chunky.lst|less where chunky is user supplied file which can change. Is this possible as an alias or... (1 Reply)
Discussion started by: ospreyeagle
1 Replies

2. Shell Programming and Scripting

Plink connections to multiple unix servers

Hi, I have a simple windows batch file which connects to a UNIX server and runs a shell script in my home directory on the server. It works perfectly, using plink + ssh keys in the background. What I plan to do is expand this batch file to connect to multiple servers and execute one script... (2 Replies)
Discussion started by: Moxy
2 Replies

3. Shell Programming and Scripting

using alias in cygwin unix

i have a cygwin unix and i would like to use alias to save a cd command.. however i lose this alias when i close out cygwin and log back in.. is there any way to save this command so that i can use it every time i log in? i am using cygwin on windows xp. thanks. (1 Reply)
Discussion started by: npatwardhan
1 Replies

4. AIX

echo in alias for Unix C-Shell Prompt

Hi, I want to set Unix prompt in C-Shell which required the break new line using alias. Ex. hostname : username : %> Now, it will be setup in .login file with alias alias cd 'cd \!* | set prompt="`hostname` : $USER : %>"' I'm unable to parse echo command or break which I can get %>... (1 Reply)
Discussion started by: buzzusa
1 Replies

5. Shell Programming and Scripting

echo in alias for Unix C-Shell Prompt

Hi, I want to set Unix prompt in C-Shell which required the break new line using alias. Ex. hostname : username : %> Now, it will be setup in .login file with alias alias cd 'cd \!* | set prompt="`hostname` : $USER : %>"' I'm unable to parse echo command or break which I can get %>... (3 Replies)
Discussion started by: buzzusa
3 Replies

6. OS X (Apple)

Where should I install an alias file under UNIX bash ?

I have a file named 'aliases' which contains a list of aliases like: alias loc='locate' alias h='history' alias .='pwd' alias ..='cd ..' alias cd..='cd .. ; pwd' .............................. Where should I put this file (alias) so when Terminal launches .bash and thus a shell at... (1 Reply)
Discussion started by: shub22
1 Replies

7. UNIX for Dummies Questions & Answers

Create alias files (not alias commands)

If one: $ find -name 'some expression' -type f > newfile and then subsequently wants to create an alias file from each pathname the find command retrieved and the > placed within 'newfile', how would one do this? Ideally, the newly created alias files would all be in one directory. I am... (3 Replies)
Discussion started by: Alexander4444
3 Replies

8. UNIX for Dummies Questions & Answers

look up Unix server alias name

Good morning everyone, does anyone know what Unix command to use to lookup a servers alias name, thanks (3 Replies)
Discussion started by: abbya
3 Replies

9. Solaris

How to set a global alias in UNIX Solaris?

Defined a user alias in unix. Not able to use that alias in a ksh scritp. I dont want to change/source in the script to set the value. Need to set the user alias as a gloabal alias to use it in a new ksh shell window. Can you please help on this? (3 Replies)
Discussion started by: rbalaj16
3 Replies

10. Shell Programming and Scripting

Need help on Plink

Hi All, Iam a newbie to the plink and need your assistance. I have referred some posts but it doesn't helps me much. I have two steps to do. 1. I have a config file which has a list of servers,username and password. 2. I have a shell script in windows which accepts arguments and need to... (0 Replies)
Discussion started by: cskumar
0 Replies
socklog(8)						      System Manager's Manual							socklog(8)

NAME
socklog - small and secure syslogd replacement for use with runit SYNOPSIS
socklog [-rRU] [unix] [path] socklog [-rR] inet [ip] [port] socklog [-rR] ucspi [args] DESCRIPTION
socklog is run under runit's runsv(8), writing syslog messages it receives from unix domain socket path or an inet udp socket ip:port through a pipe provided by runsv(8) to a svlogd(8) process. socklog can be run as an ucspi application to listen to an unix domain stream socket and for more flexible distributed logging. If the environment variables $UID and/or $GID are present, socklog drops permissions to those ids after creating and binding the socket (not in ucspi mode). socklog converts syslog facility and priority information to names (facility.priority:) as found in /usr/include/syslog.h at compile time if present. On solaris socklog also accepts sun_stream as first argument. Please see the web page for details. UNIX SOCKET
socklog [ unix ] [ path ] Starting socklog with the 1st argument unix, socklog will listen to the unix domain socket path. If path is omitted, the default /dev/log is used. The 1st argument may be omitted, default is unix. INET SOCKET
socklog inet [ ip ] [ port ] Starting socklog with the 1st argument inet, socklog will listen to the inet udp socket ip:port. If ip starts with 0, socklog will bind to all local interfaces. If port is less or equal 1024, socklog must be run by root. port may be omitted, default is 514. ip may be omitted, default is 0. socklog prepends a.b.c.d: to each syslog message it receives, where a.b.c.d is the ip address of the connecting system. UCSPI MODE
socklog ucspi [ args ] Starting socklog with the 1st argument ucspi, socklog will run as an ucspi application. Normally socklog will only be started in ucspi mode by an ucspi server tool, such as tcpsvd(8), tcpserver(1) or unixserver. For each arg, socklog will prepend $arg: to each syslog message, if the environment variable $arg is present (maximum is 8). OPTIONS
-r raw. Write the raw syslog messages (no conversion of facility and priority) to the pipe, additionally to the log messages with sys- log facility and priority converted to names. -R raw only. Same as -r above, but write the raw syslog messages only. -U respect umask. Don't set umask to 0 before creating a unix domain socket, but respect the current setting of umask(2). This option only takes effect in unix mode. SEE ALSO
sv(8), runsvdir(8), runsv(8), svlogd(8), tryto(1), uncat(1), socklog-check(8), tcpsvd(8), nc(1) http://smarden.org/socklog/ http://smarden.org/runit/ AUTHOR
Gerrit Pape <pape@smarden.org> socklog(8)
All times are GMT -4. The time now is 01:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy