Sponsored Content
Full Discussion: How to preserve gawk in ssh?
Top Forums Shell Programming and Scripting How to preserve gawk in ssh? Post 302788711 by Corona688 on Tuesday 2nd of April 2013 11:21:56 AM
Old 04-02-2013
This has two problems.

First and foremost, you cannot nest single quotes in single quotes. You can't escape anything in single quotes either, so not even backslashes will fix it. You'll have to put double quotes on the outside.

Second, not all systems have gawk. In fact very few systems have gawk; even systems like Linux which default to it just call it awk.

Your awk command is simple enough that hopefully vanilla awk can handle it, even the awful old versions some systems have.

Code:
for server in test1 test2; do ssh $server "/usr/listinfo policy -L | awk 'NR == 2'";done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

preserve timestamp of symlinks using rsync

Hi, In my shell programming, When i copy sym links from one server to another server using rsync it does not preserve time stamp . it showing current time after copying in destination server.the command i used is rsync -vaR -- How can i preserve sym links time stamp using rsync. Thanx (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies

2. Shell Programming and Scripting

How to preserve NL in Ksh variables?

I'm trying to set a variable to the output of a command. This is what the comand output to the display looks like: />hciconndump -v TOsiu Dump of connection(s): TOsiu ---------------------------------------------------------------------- Process: A60Tsiu Connection: TOsiu... (2 Replies)
Discussion started by: troym72
2 Replies

3. Shell Programming and Scripting

Preserve first line and search in others

Hi gurus Is possible to preserve first line of text and search in another lines ? the only way that I think is: ps aux | awk '{if (NR==1) {print $0} else if ($11 ~ /sshd/) {print $0}}' but is there any more elegant way ? thanks (4 Replies)
Discussion started by: wakatana
4 Replies

4. UNIX for Advanced & Expert Users

update files and preserve date

I have a bunch of historical files that need to be modified, as the file source announced there is an error in them which should be corrected. I am planning to use sed to do the mass update, but I would like to know if there is a way to preserve files last modified date/time, so later ls -ltr... (3 Replies)
Discussion started by: migurus
3 Replies

5. Shell Programming and Scripting

Unable to preserve hard links. Why?

Hi, I'm trying to create a Makefile that would automate remastering Knoppix distribution. As a part of the process I am mounting using linux cloop device a compressed filesystem and copy the content out of it to separate dir. However during that process I need to preserve hard links and it... (9 Replies)
Discussion started by: dpc.ucore.info
9 Replies

6. Shell Programming and Scripting

Using expect doesn't preserve the stderr

Hello, I am performing the follwing line from a unix server: expect -c 'spawn ssh otherHost chown -R user:group /usr ; expect password: ; send 123456\n ; interact ;' I am getting return value 0, an empty stderr and a stdout that says "/usr/... Not owner, /usr/... Not Owner ..". If I... (2 Replies)
Discussion started by: lastZenMaster
2 Replies

7. Programming

Ways to preserve a memory cache

The environment is Java/Windows. The program keeps near real-time state in memory cache, which is updated by multiple sources, size of the cache is roughly 500 MB, frequency of updates is ~ 20 per second. I am looking into different ways to keep current snapshot of the memory on the disk for a)... (9 Replies)
Discussion started by: migurus
9 Replies

8. Shell Programming and Scripting

Preserve value between different run of script.

I have a script that test for server up status. I need to preserve the value of status between every run of the script. test.sh log=$(cat /tmp/log_status) start loop test for servers print status for munin etc test=$(echo -e "${test}${status},") end loop echo $test >... (4 Replies)
Discussion started by: Jotne
4 Replies

9. Shell Programming and Scripting

awk - How to preserve whitespace?

Given a file: # configuration file for newsyslog # $FreeBSD: /repoman/r/ncvs/src/etc/newsyslog.conf,v 1.50 2005/03/02 00:40:55 brooks Exp $ # # Entries which do not specify the '/pid_file' field will cause the # syslogd process to be signalled when that log file is rotated. This # action... (10 Replies)
Discussion started by: jnojr
10 Replies

10. Shell Programming and Scripting

How to preserve the value of a variable from being overwritten?

Hi All, I am new new to unix.com, I have a question related to shell scripting. We have a Oracle database backup shell script, which can be used for taking full, incremental & archive log backup based on the parameters passed. Within the script we export a variable as export... (5 Replies)
Discussion started by: veeresh_15
5 Replies
bup-margin(1)						      General Commands Manual						     bup-margin(1)

NAME
bup-margin - figure out your deduplication safety margin SYNOPSIS
bup margin [options...] DESCRIPTION
bup margin iterates through all objects in your bup repository, calculating the largest number of prefix bits shared between any two entries. This number, n, identifies the longest subset of SHA-1 you could use and still encounter a collision between your object ids. For example, one system that was tested had a collection of 11 million objects (70 GB), and bup margin returned 45. That means a 46-bit hash would be sufficient to avoid all collisions among that set of objects; each object in that repository could be uniquely identified by its first 46 bits. The number of bits needed seems to increase by about 1 or 2 for every doubling of the number of objects. Since SHA-1 hashes have 160 bits, that leaves 115 bits of margin. Of course, because SHA-1 hashes are essentially random, it's theoretically possible to use many more bits with far fewer objects. If you're paranoid about the possibility of SHA-1 collisions, you can monitor your repository by running bup margin occasionally to see if you're getting dangerously close to 160 bits. OPTIONS
--predict Guess the offset into each index file where a particular object will appear, and report the maximum deviation of the correct answer from the guess. This is potentially useful for tuning an interpolation search algorithm. --ignore-midx don't use .midx files, use only .idx files. This is only really useful when used with --predict. EXAMPLE
$ bup margin Reading indexes: 100.00% (1612581/1612581), done. 40 40 matching prefix bits 1.94 bits per doubling 120 bits (61.86 doublings) remaining 4.19338e+18 times larger is possible Everyone on earth could have 625878182 data sets like yours, all in one repository, and we would expect 1 object collision. $ bup margin --predict PackIdxList: using 1 index. Reading indexes: 100.00% (1612581/1612581), done. 915 of 1612581 (0.057%) SEE ALSO
bup-midx(1), bup-save(1) BUP
Part of the bup(1) suite. AUTHORS
Avery Pennarun <apenwarr@gmail.com>. Bup unknown- bup-margin(1)
All times are GMT -4. The time now is 09:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy