Sponsored Content
Full Discussion: Piping to a python script
Top Forums Shell Programming and Scripting Piping to a python script Post 302690925 by gplayersv on Thursday 23rd of August 2012 02:54:01 PM
Old 08-23-2012
Thank you for the insights! Didn't think of that...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Piping to ex from a script

Is anyone piping commands to ex from scripts? I.E. echo '%s/change this/to that/\nwq' | ex file.name I've been using it for years with AIX, Solaris, SGI, with variations ksh and Mandriva and others with pdksh. I've just started using CentOS with ksh and it no longer works. I've tried single... (2 Replies)
Discussion started by: mph
2 Replies

2. Shell Programming and Scripting

Hi Python and shell script,the script hangs

Hi I need to run a shell script from a TCL script,the shell script in trun will run a python script 1.Tcl script set filename "./GopiRun.sh" 2.GopiRun.sh python ./psi.py $MYSB/test_scripts/delivery/gpy1.py 3.I have my gpy1.py script. Here the problem i am facing is on running... (0 Replies)
Discussion started by: nathgopi214
0 Replies

3. Programming

piping from C to python in UNIX

Hi, I'm trying to wrap my head around piping in C - I've got a small C program that forks and pipes stuff from the child process to the parent process. Currently the child process calls a C program that squirts out random numbers which then pipes the result to the parent process. The... (0 Replies)
Discussion started by: Dreams in Blue
0 Replies

4. Shell Programming and Scripting

KSH script: piping passes command-line arguments

Dear forum I have the following small script: #!/bin/ksh echo -e "abba-o" | awk -F '-' '{ print $2 }' | cut -b 1It needs to be ksh.. in bash I don't have this problem. If I run this on opensuse 10.2 I get this as output: e If I run this on suse enterprise 10 sp2 then I get this: o ... (1 Reply)
Discussion started by: gemtry
1 Replies

5. Shell Programming and Scripting

problem piping input to script with echo

I am trying to have a script run without interaction from the command line. So in my script i have a line like this echo -e "\n\n\ny\ny\n" | ./script the goal being the ability to mimic 3 Enter presses and 2 'y/n' responses with 'y' followed by enter. For some reason tho, it is not... (1 Reply)
Discussion started by: mcdef
1 Replies

6. Shell Programming and Scripting

Piping output from a command into bash script

Hi all. I am using procmail to deliver an email to a script I am developing. Procmail delivers the email to the script on standard input. I imagine this is the same as piping input from a command into the script. Hence I've been testing my script by running echo 'test' | sms-autosend-backup.sh ... (2 Replies)
Discussion started by: akindo
2 Replies

7. Shell Programming and Scripting

Passing variable from shell script to python script

I have a shell script main.sh which inturn call the python script ofdm.py, I want to pass two variables from shell script to python script for its execution. How do i achieve this ????? Eg: main.sh a=3 b=3; c= a+b exec python ofdm.py ofdm.py d=c+a Thanks in Anticipation (4 Replies)
Discussion started by: shashi792
4 Replies

8. Shell Programming and Scripting

Exit code from piping in unix shell script

Hi , I have following code in my shell script : "$TS_BIN/tranfrmr" "${TS_SETTINGS}/tranfrmr_p1.stx" "${TS_LOGS}/tranfrmr_p1.err" | ( "$TS_BIN/cusparse" "${TS_SETTINGS}/cusparse_p2.stx" "${TS_LOGS}/cusparse_p2.err" | ( "$TS_BIN/tsqsort" "${TS_SETTINGS}/srtforpm_p3.stx"... (8 Replies)
Discussion started by: sonu_pal
8 Replies

9. Shell Programming and Scripting

Capture run time of python script executed inside shell script

I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution... (2 Replies)
Discussion started by: Adfire
2 Replies

10. Windows & DOS: Issues & Discussions

How to execute python script on remote with python way..?

Hi all, I am trying to run below python code for connecting remote windows machine from unix to run an python file exist on that remote windows machine.. Below is the code I am trying: #!/usr/bin/env python import wmi c = wmi.WMI("xxxxx", user="xxxx", password="xxxxxxx")... (1 Reply)
Discussion started by: onenessboy
1 Replies
SWAPCTL(2)						      BSD System Calls Manual							SWAPCTL(2)

NAME
swapctl -- modify swap configuration LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <unistd.h> #include <sys/swap.h> int swapctl(int cmd, void *arg, int misc); DESCRIPTION
The swapctl function is used to add and delete swap devices, and modify their configuration. The cmd parameter specifies the operation to be performed. The arg and misc parameters have different meanings, depending on the cmd parame- ter. 1. If cmd is SWAP_NSWAP, the current number of swap devices in the system is returned. The arg and misc parameters are ignored. 2. If cmd is SWAP_STATS, the current statistics for swap devices are returned in the arg parameter. No more than misc swap devices are returned. The arg parameter should point to an array of at least misc struct swapent structures: struct swapent { dev_t se_dev; /* device id */ int se_flags; /* entry flags */ int se_nblks; /* total blocks */ int se_inuse; /* blocks in use */ int se_priority; /* priority */ char se_path[PATH_MAX+1]; /* path to entry */ }; The flags are defined as SWF_INUSE in use: we have swapped here SWF_ENABLE enabled: we can swap here SWF_BUSY busy: I/O happening here SWF_FAKE fake: still being built 3. If cmd is SWAP_ON, the arg parameter is used as a pathname of a file to enable swapping to. The misc parameter is used to set the priority of this swap device. 4. If cmd is SWAP_OFF, the arg parameter is used as the pathname of a file to disable swapping from. The misc parameter is ignored. 5. If cmd is SWAP_CTL, the arg and misc parameters have the same function as for the SWAP_ON case, except that they change the prior- ity of a currently enabled swap device. 6. If cmd is SWAP_DUMPDEV, the arg parameter is used as the pathname of a device to use as the dump device, should the system panic. 7. If cmd is SWAP_GETDUMPDEV, the arg parameter points to a dev_t, which is filled in by the current dump device. When swapping is enabled on a block device, the first portion of the disk is left unused to prevent any disklabel present from being over- written. This space is allocated from the swap device when the SWAP_ON command is used. The priority of a swap device can be used to fill faster swap devices before slower ones. A priority of 0 is the highest, with larger num- bers having lower priority. For a fuller discussion on swap priority, see the SWAP PRIORITY section in swapctl(8). RETURN VALUES
If the cmd parameter is SWAP_NSWAP or SWAP_STATS, swapctl() returns the number of swap devices, if successful. The SWAP_NSWAP command is always successful. Otherwise it returns 0 on success and -1 on failure, setting the global variable errno to indicate the error. ERRORS
swapctl() succeeds unless: [EACCES] Search permission is denied for a component of the path prefix. [EBUSY] The device specified by arg has already been made available for swapping. [EFAULT] arg points outside the process' allocated address space. [EINVAL] The device configured by arg has no associated size, or the cmd was unknown. [EIO] An I/O error occurred while opening the swap device. [ELOOP] Too many symbolic links were encountered in translating the pathname. [ENAMETOOLONG] A component of a pathname exceeded {NAME_MAX} characters, or an entire path name exceeded {PATH_MAX} characters. [ENOENT] The named device does not exist. For the SWAP_CTL command, the named device is not currently enabled for swapping. [ENOTDIR] A component of the path prefix is not a directory. [ENXIO] The major device number of arg is out of range (this indicates no device driver exists for the associated hardware); or the block device specified by arg is not marked as a swap partition in the disklabel. [EPERM] The caller is not the super-user. SEE ALSO
swapctl(8) HISTORY
The swapctl() function call appeared in NetBSD 1.3. The se_path member was added to struct swapent in NetBSD 1.4, when the header file was also moved from <vm/vm_swap.h> to its current location in <sys/swap.h>. AUTHORS
The current swap system was designed and implemented by Matthew Green <mrg@eterna.com.au>, with help from Paul Kranenburg <pk@NetBSD.org> and Leo Weppelman <leo@NetBSD.org>, and insights from Jason R. Thorpe <thorpej@NetBSD.org>. BSD
May 17, 2010 BSD
All times are GMT -4. The time now is 01:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy