Sponsored Content
Top Forums UNIX for Advanced & Expert Users awk trouble inside another command Post 303037511 by cokedude on Saturday 3rd of August 2019 08:25:29 PM
Old 08-03-2019
Quote:
Originally Posted by jim mcnamara
I've stayed away because I could not get past the dsh -w
AIX dsh and linux dash (sometimes dsh) do not have a -w option. Per manpages for both. What does that do -- dsh -w ?

So I'm not sure what is going on. Plus the whole code design concept seems to me to be based on 'one-liner' thinking. Which is cool but not always maintainable as you are finding out.
It looks like you are trying to kill processes with files open - somewhere special. What OS and shell are you using?
I am using AIX. Normally dsh runs a command against all of your servers in your server list. When you add the -w option to dsh it allows you to select which server you want to run your command on. In my case I want to run my command on server1. I could run my command without the -w option but it would be harder to debug my problem.

I am not very good at using multiple single and double quotes, and escaping. I think that is my issue.
 

10 More Discussions You Might Find Interesting

1. AIX

Trouble formatting egrep command with AWK

Hi, I'm new to scripting and AIX. I'm running the following: lspv | awk '{ print "lspv",$1" | egrep 'PP\|PHYSICAL'; lspv -l",$1 }' Which creates this command: lspv hdisk0 | egrep PP|PHYSICAL; lspv -l hdisk0 lspv hdisk1 | egrep PP|PHYSICAL; lspv -l hdisk1 Troube is, I need the... (2 Replies)
Discussion started by: cruiser
2 Replies

2. Shell Programming and Scripting

Running command inside awk

Hi, I have a awk script to read a CSV file. After reading the values i want to call a executable (nameely call_it) with the values what i read from the scv file. I dont want to use system command inside the awk. Is there any other way to run the executable from the awk script Thanks ... (1 Reply)
Discussion started by: Raghuram.P
1 Replies

3. Shell Programming and Scripting

How to use same variable value inside as well as outside of the awk command?

Hi Jim, The following script is in working state. But i m having one more problem with awk cmd. Could you tell me how to use any variable inside awk or how to take any variable value outside awk. My problem is i want to maintain one property file in which i am declaring variable value into that... (12 Replies)
Discussion started by: Ganesh Khandare
12 Replies

4. Shell Programming and Scripting

Trouble with passing Variable from bash to awk gsub command

Would really appreciate it if someone could point out my mistake in this line of code, i've been staring blankly at it trying everything i can think of some time now and coming up with nothing. #!/bin/bash echo "Enter Username" read Username awk -F: -v var=${Username} '/^var:/... (9 Replies)
Discussion started by: Nostyx
9 Replies

5. Shell Programming and Scripting

Multiple command execution inside awk command during xml parsing

below is the output xml string from some other command and i will be parsing it using awk cat /tmp/alerts.xml <Alert id="10102" name="APP-DS-ds_ha-140018-componentFailure-S" alertDefinitionId="13982" resourceId="11427" ctime="1359453507621" fixed="false" reason="If Event/Log Level(ANY) and... (2 Replies)
Discussion started by: vivek d r
2 Replies

6. Shell Programming and Scripting

Help in using date command inside awk

Hi All, bash-3.2$ autorep -J BOX_NAME% -l0 | grep BOX_NAME| awk -f awkScript.awk sh: -c: line 0: unexpected EOF while looking for matching `"' sh: -c: line 1: syntax error: unexpected end of file BOX_NAME SU 06/21/2013 03:44:03 06/21/2013 07:46:37 0 #My awkfile { ... (3 Replies)
Discussion started by: ddspark
3 Replies

7. Shell Programming and Scripting

Grep command inside awk

Hi, I would like to use grep command inside awk. Here is my requirement below : file.txt col1 col2 col3 col 4 col 5 wrxwrx 124 jun 3 Sensex.EMEA wrxwrx 120 jun 4 Emex.US wrxwrx 130 feb 3 passion.AUS wrxwrx 145 feb 9 lession.AUS wrxwrx 130 feb 5 pass.US wrxwrx 130 feb 8... (5 Replies)
Discussion started by: Balasankar
5 Replies

8. Shell Programming and Scripting

Command in inside awk statement

Hello can you please help me with below script which is meant to delete clients from multiple netbackup policies I want to run a command insdie awk statement apparelnlty this script is not working for me for i in $( cat clients_list) do bppllist -byclient $i | awk... (6 Replies)
Discussion started by: Sara_84
6 Replies

9. Shell Programming and Scripting

Trouble with awk command

Hi, I need to read a string with ; separated using loop one filed by one field and perform some operation. Can you please check and let me know how to print command parameterised. key=phani;ravi;kiran number_of_keys=`echo $key|awk '{print NF}' FS=';'` for (( i = 1; i <= $number_of_keys;... (4 Replies)
Discussion started by: Ravindra Swan
4 Replies

10. Shell Programming and Scripting

Trouble using awk command

Hi, I have 2 .txt pads containing data. I need a script which reads content of one .txt file, performs some operations and calculates a number which is stored in a variable. Now , all the content of another .txt pad should be appended to first .txt pad at pre calculated nth line number. ... (4 Replies)
Discussion started by: Ravindra Swan
4 Replies
ganeti-listrunner(8)						   Version 2.5.2					      ganeti-listrunner(8)

NAME
ganeti-listrunner - Run commands in parallel over multiple machines SYNOPSIS
ganeti-listrunner -l logdir {-x executable | -c shell-cmd} {-f hostfile | -h hostlist} [-a aux-file] [-b batch-size] [-u username] [-A] DESCRIPTION
ganeti-listrunner is a tool to run commands in parallel over multiple machines. It differs from dsh or other tools in that it asks for the password once (if not using ssh-agent) and then reuses the password to connect to all machines, thus being easily usable even when public key authentication or Kerberos authentication is not available. It can run either a command or a script (which gets uploaded first and deleted after execution) on a list of hosts provided either via a file (one host per line) or as a comma-separated list on the commandline. The output (stdout and stderr are merged) of the remote execution is written to a logfile. One logfile per host is written. OPTIONS
The options that can be passed to the program are as follows: -l logdir The directory under which the logfiles files should be written. -x executable The executable to copy and run on the target hosts. -c shell-cmd The shell command to run on the remote hosts. -f hostfile The file with the target hosts, one hostname per line. -h hostlist Comma-separated list of target hosts. -a aux-file A file to copy to the target hosts. Can be given multiple times, in which case all files will be copied to the temporary directory. The executable or the shell command will be run from the (temporary) directory where these files have been copied. -b batch-size The host list will be split into batches of batch-size which will be processed in parallel. The default if 15, and should be increased if faster processing is needed. -u username Username to connect as instead of the default root username. -A Use an existing ssh-agent instead of password authentication. --args Arguments to pass to executable (-x). EXIT STATUS
The exist status of the command will be zero, unless it was aborted in some way (e.g. ^C). EXAMPLE
Run a command on a list of hosts: listrunner -l logdir -c "uname -a" -h host1,host2,host3 Upload a script, some auxiliary files and run the script: listrunner -l logdir -x runme.sh -a seed.dat -a golden.dat -h host1,host2,host3 SEE ALSO
dsh(1), cssh(1) REPORTING BUGS
Report bugs to project website (http://code.google.com/p/ganeti/) or contact the developers using the Ganeti mailing list (ganeti@google- groups.com). SEE ALSO
Ganeti overview and specifications: ganeti(7) (general overview), ganeti-os-interface(7) (guest OS definitions). Ganeti commands: gnt-cluster(8) (cluster-wide commands), gnt-job(8) (job-related commands), gnt-node(8) (node-related commands), gnt- instance(8) (instance commands), gnt-os(8) (guest OS commands), gnt-group(8) (node group commands), gnt-backup(8) (instance import/export commands), gnt-debug(8) (debug commands). Ganeti daemons: ganeti-watcher(8) (automatic instance restarter), ganeti-cleaner(8) (job queue cleaner), ganeti-noded(8) (node daemon), ganeti-masterd(8) (master daemon), ganeti-rapi(8) (remote API daemon). Ganeti htools: htools(1) (generic binary), hbal(1) (cluster balancer), hspace(1) (capacity calculation), hail(1) (IAllocator plugin), hscan(1) (data gatherer from remote clusters). COPYRIGHT
Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc. Permission is granted to copy, distribute and/or modify under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. Ganeti ganeti-listrunner(8)
All times are GMT -4. The time now is 01:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy