Sponsored Content
Top Forums Shell Programming and Scripting Concatenate piped output and some var? Post 302398951 by Franklin52 on Friday 26th of February 2010 01:58:24 AM
Old 02-26-2010
Code:
var1=${var1}$(blah blah commands)

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Exclude Certain Entries from Piped or Redirected Output?

I want to execute a command something like: find / -name "jni.h" and I want to direct the output of that command to some type of filter that will leave out all the lines reporting inaccessible directories (permission unavailable). Is this a pipe or a redirect? For example, output like... (1 Reply)
Discussion started by: downplay
1 Replies

2. Shell Programming and Scripting

find output seems to change when piped

Currently, i am trying to create a simple robust script that is intended to move the contents of a given source directory to a target directory. Optionally, the script should allow to either move the whole source dir content, or dotfiles only, or visible files only. I am aware the target directory... (0 Replies)
Discussion started by: shells_bells
0 Replies

3. Shell Programming and Scripting

Directing only part of a script's output to piped application

Is there a way to keep the output of a script displayed on the terminal when it's run by itself, but suspend part of that output and only have a specific part delivered when it's piped to another script or program? I'm thinking something like the following pseudocode: #!/bin/bash ... (1 Reply)
Discussion started by: trigg
1 Replies

4. Shell Programming and Scripting

Piped output from SSH tunnel hangs?

Hi All, When starting an SSH tunnel, piped output 'hangs' (on AIX) : ssh -Nf -Llocalhost:22000:server:22 proxy | cat -vet - ... hangs ... Does anybody know how to prevent this? Of course, in my script I don't use the tunnel as I do in the example above. In my script the call to ssh is... (7 Replies)
Discussion started by: whbos
7 Replies

5. Shell Programming and Scripting

script output should be piped to a file

hi i have a script named mount.sh under the location /data/scripts/ in my aix box i want this script this to be run everyday morning at 04:45 AM and the output of the script should be piped to a file how to do this ? (3 Replies)
Discussion started by: samsungsamsung
3 Replies

6. Shell Programming and Scripting

Cat piped output

Hello, How can I efficiently cat piped output with another file? > (awk command) | cat file1 (piped output) Thanks! (11 Replies)
Discussion started by: palex
11 Replies

7. Shell Programming and Scripting

Output piped to case insensitive awk

I have an encrypted password file, and I've created a simple script to search the password file for a particular record. There are multiple lines per record, so I'm using a record delimiter. #!/bin/bash PATTERN=$1 openssl des3 -d -salt -in ~/docs/pass.des3 | awk '{ FS="\n" ; RS="*" }... (2 Replies)
Discussion started by: 0rac1e
2 Replies

8. Shell Programming and Scripting

Can't Output Piped Perl In-line command to a File

Hello, I'm pretty stumped, and I don't know why I am not able to redirect the output to the 'graphme' file with the command below in Fedora 18. tcpdump -l -n -t "tcp == 18" | perl -ane '($s,$j)=split(/,/,$F,2); print "$s\n";' > graphme In case you're wondering, I was following the example... (2 Replies)
Discussion started by: ConcealedKnight
2 Replies

9. Shell Programming and Scripting

Print line number from piped output

i need to do something like this: script.sh #!/bin/sh echo "hello" echo "My First name is John" echo "My Last name is Smith" echo "I am here to save you a lot of work" sed -n 4,5p $0 i dont want to run the script. i just want to pull out specific line from it. so the logic here... (5 Replies)
Discussion started by: SkySmart
5 Replies

10. Programming

Running java script from piped output

to run most other scripts through a pipe, something similar to the following is usually enough: cat script.sh | sh cat perl.pl | perl -- "<arguments" However, for javascript command line scripts, i cant seem to get this to work. Any ideas? cat hull.js #!/usr/bin/js ... (3 Replies)
Discussion started by: SkySmart
3 Replies
STAPDYN(8)						      System Manager's Manual							STAPDYN(8)

NAME
stapdyn - systemtap dyninst runtime SYNOPSIS
stapdyn [ OPTIONS ] MODULE [ MODULE-OPTIONS ] DESCRIPTION
The stapdyn program is the dyninst back-end of the Systemtap tool. It expects a shared library produced by the front-end stap tool, when run with --dyninst. Splitting the systemtap tool into a front-end and a back-end allows a user to compile a systemtap script on a development machine that has the debugging information (need to compile the script) and then transfer the resulting shared objevct to a production machine that doesn't have any development tools or debugging information installed. Please refer to stappaths(7) for the version number, or run rpm -q systemtap (fedora/red hat) apt-get -v systemtap (ubuntu) OPTIONS
The stapdyn program supports the following options. Any other option prints a list of supported options. -v Verbose mode. -V Print version number and exit. -w Suppress warnings from the script. -c CMD Command CMD will be run and the stapdyn program will exit when CMD does. The '_stp_target' variable will contain the pid for CMD. -x PID The '_stp_target' variable will be set to PID. -o FILE Send output to FILE. If the module uses bulk mode, the output will be in percpu files FILE_x(FILE_cpux in background and bulk mode) where 'x' is the cpu number. This supports strftime(3) formats for FILE. -C WHEN Control coloring of error messages. WHEN must be either "never", "always", or "auto" (i.e. enable only if at a terminal). If the op- tion is missing, then "auto" is assumed. Colors can be modified using the SYSTEMTAP_COLORS environment variable. See the stap(1) manual page for more information on syntax and behaviour. var1=val Sets the value of global variable var1 to val. Global variables contained within a script are treated as options and can be set from the stapdyn command line. ARGUMENTS
MODULE is either a module path or a module name. If it is a module name, the module will be looked for in the following directory (where 'VERSION' is the output of "uname -r"): /lib/modules/VERSION/systemtap $ stap --dyninst -p4 -m mod1 -e 'global var1="foo"; probe begin{printf("%s ", var1); exit()}' Running this with an additional module argument: $ stapdyn mod1.so var1="HelloWorld" HelloWorld Spaces and exclamation marks currently cannot be passed into global variables this way. EXAMPLES
See the stapex(3stap) manual page for a collection of sample scripts. Here is a very basic example of how to use stapdyn. First, use stap to compile a script. The stap program will report the pathname to the resulting module. $ stap --dyninst -p4 -e 'probe begin { printf("Hello World! "); exit() }' /home/user/.systemtap/cache/85/stap_8553d83f78c_265.so Run stapdyn with the pathname to the module as an argument. $ stapdyn /home/user/.systemtap/cache/85/stap_8553d83f78c_265.so Hello World! SAFETY AND SECURITY
Systemtap, in DynInst mode, is a developer tool, and runs completely unprivileged. The Linux kernel will only permit one's own processes to be accessed, which is enforced by the ptrace(2) system call. See the stap(1) manual page for additional information on safety and secu- rity. SEE ALSO
stap(1), stapprobes(3stap), stap-server(8), staprun(8), stapex(3stap) BUGS
Use the Bugzilla link of the project web page or our mailing list. http://sourceware.org/systemtap/, <systemtap@sourceware.org>. STAPDYN(8)
All times are GMT -4. The time now is 09:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy