1. command similar to one u provided, but assigning the string in the brackets to a variable. i will then use this variable to generate an md5 (this i can do).
2. replace the content of the brackets with the md5. This command u have already kindly provided:
Code:
echo "0001 zz 43242 [replace this text] name" |sed '/^0001/s/\[.*\]/my_md5/'
........only thing is, i need the brackets to remain as they are and not be removed along with the original string.
One of the senior administrators gave me a shell script to modify and it begins as follows:
if ] && ]
{more code follows}
Why the double square brackets? (10 Replies)
Hi,
I just came across an interesting shell script syntax like the one below:
] && (trap 'rm -rf ${WORK_DIR}/*.$$; echo "\n\nInterrupted !!\n\n"; exit 4' 1 2 3 15)
Can someone please explain the code snippet above?
The trap command bit is fine but ] && is the hazy part.
Generally we use an... (2 Replies)
Hi All,
I have a text file which looks like this:
computer programming
systems engineering
I want to get rid of these square brackets and also the text that is inside these brackets. So that my final text file looks like this:
computer programming
systems engineering
I am using... (3 Replies)
Hi All,
After searching about this, I could find some solutions but I am not sure why it is not working in my case.
I have a text file with contents between two square brackets. The text file looks like this:
Use tags when you post any code so others can easily read your code. You can... (2 Replies)
Hi frieds, I don't understand the difference between single square bracket and double square brackets in a IF condition.
Ex.
if ;
then
RETURNJOB=1
else
RETURNJOB=0
fi
It run, but this
if ];
then
RETURNJOB=1
else
RETURNJOB=0
fi (4 Replies)
Please can someone help with this?
I have a file with lines as follows:
word1 word2 word3 word4 word5 word6 word7 word8
word1 word2 word3 word4 word5 word6 word7 word8
word1 word2 word3 word4 word5 word6 word7 word8
word1 word2 word3 word4 word5 word6 word7 word8
When I use the... (7 Replies)
Hello all,
I have the following problem:
$ cat infile
this is spam and i need this too
this is spam and i need this too
$ perl -nwe '$_ =~ /]+ \]+)\]\]*\]? (\+)$/; print "$1 - $2\n";' infile
i need this - too
i need this - and i need this too
I am not sure how many occurences of... (13 Replies)
Hi All,
Hope you all are doing good. Yesterday in my project i came across a scenario which i can not guess why it was working in one region and why it was not in another region. Please find my issue below.
I am using AIX version 6.0 of UNIX in my project, in shell scripting i have the... (1 Reply)
Hi all,
I have a text file similar to this:
Text
More text
Etc
Stuff
That
Is
Needed
Etc
Etc
This contains over 70 entries and each entry has several lines of text below the name in square brackets. (5 Replies)
Discussion started by: Scally
5 Replies
LEARN ABOUT DEBIAN
bbdigest
BBDIGEST(1) General Commands Manual BBDIGEST(1)NAME
bbdigest - calculate message digests
SYNOPSIS
bbdigest md5|sha1|rmd160 [filename]
DESCRIPTION bbdigest(1) is a utility to calculate message digests for a file or document. It is used when defining HTTP- or FTP-based content checks,
where bbtest-net(1) checks that a URL returns a specific document; instead of having to compare the entire document, the comparison is done
against a pre-computed message digest value using the MD5, RIPEMD160, SHA1 or any of the SHA2 (SHA-512, SHA-256, SHA-384, SHA-224) message
digest algorithms.
The optional filename parameter is the input file whose message digest should be calculated; if no filename is given, the data is read from
standard input.
bbdigest outputs a string containing the digest algorithm and the computed message digest. This is in a format suitable for use in the bb-
hosts(5) definition of a content check.
EXAMPLE
$ bbdigest md5 index.html
md5:88b81b110a85c83db56a939caa2e2cf6
$ curl -s http://www.foo.com/ | bbdigest sha1
sha1:e5c69784cb971680e2c7380138e04021a20a45a2
SEE ALSO bbtest-net(1), bb-hosts(5)Xymon Version 4.2.3: 4 Feb 2009 BBDIGEST(1)