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
localemanager(8)					    BSD System Manager's Manual 					  localemanager(8)

NAME
localemanager -- Configure OpenDirectory Server Locales SYNOPSIS
localemanager operation [-l localename] [-subnet 1.2.3.4/5] [-server servername] [-i IP address] DESCRIPTION
localemanager creates, destroys, and edits OpenDirectory Server Locale information. Locales are collections of OpenDirectory servers to assist clients in locating the nearest OpenDirectory Server. To use OpenDirectory Server Locales, simply create a locale on an OD server with the createLocale operation. Then add servers and subnets to the locale. All localemanager operations are performed on the local OpenDirectory node. The first time a locale is created, a DefaultLocale will automatically be created as well. The DefaultLocale will be used for any clients that don't match a subnet in any other locale. Before a locale can be configured, the server must already be an OpenDirectory server. Locales can be defined on each of the OD servers or on a single OD server in the group of OD master/replicas. For the latter, the locale information will get replicated to all of the other servers but locales will need to be "enabled" on the other servers by running the command localemanager enableLocales. Commands: help Displays the commands and options. createLocale Creates a new locale on the local OD server. This command requires the -l option. deleteLocale Deletes a locale from the local OD server. This command requires the -l option. showLocale Displays the current locale(s). The -l option can be used to display a specific locale. If -l is not specified, all locales are displayed. enableLocales Enables the use of locales on an OD server. This command is automatically run the first time any localemanager command is run on an OD server. Therefore this command only needs to be run if no other localemanager commands have been (or will be) run on this server. addSubnet Adds a new subnet to the specified locale. This command requires the -l -subnet options. removeSubnet Removes a subnet from the specified locale. This command requires -l -subnet options. addServer Adds a server to the specified locale. This command requires the -l -server options. If the -i option is specified, that IP address will be used by locale clients. This may be useful for multi-homed servers to restrict locale clients to a specific network interface. If the -i option is not specified the IP address(es) will be looked up. removeServer Removes a server from the specified locale. This command requires -l -server options. If the -i option is specified, only that IP address will be removed from the locale. If the -i option is no specified, all of the server's IP addresses will be removed from the locale. Options: -l locale Locale name. -subnet 192.168.0.0/16 Subnet specified in CIDR notation. -server server.example.com Server fully-qualified domain name. -i 192.168.1.1 Use this IP address for the server. Typically used to limit locale clients to a specific interface on a multi-homed server. FILES
/var/log/localemanager.log localemanager log file. SEE ALSO
slapconfig(8) HISTORY
First introduced in Mac OS X 10.7 Darwin June 1, 2019 Darwin
All times are GMT -4. The time now is 03:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy