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
truchet
truchet(6x) XScreenSaver manual truchet(6x)NAME
truchet - draws curved or angular Truchet patterns
SYNOPSIS
truchet [-display host:display.screen] [-foreground color] [-background color] [-window] [-root] [-mono] [-install] [-visual visual]
[-delay milliseconds] [-min-width integer] [-min-height integer] [-max-width integer] [-max-height integer] [-max-linewidth integer] [-min-
linewidth integer] [-erase] [-no-erase] [-erase-count integer] [-square] [-not-square] [-curves] [-no-curves] [-angle] [-no-angles]
[-scroll] [-scroll-overlap integer] [-anim-delay integer] [-anim-step-size integer]
[-fps]
DESCRIPTION
The truchet program draws arc and line based Truchet patterns.
OPTIONS
truchet accepts the following options:
-window Draw on a newly-created window. This is the default.
-root Draw on the root window.
-mono If on a color display, pretend we're on a monochrome display.
-install
Install a private colormap for the window.
-visual visual
Specify which visual to use. Legal values are the name of a visual class, or the id number (decimal or hex) of a specific visual.
-delay milliseconds
How long to wait between drawing each screenful. Default is 1 seconds.
-min-width integer
The minimum width in pixels of each square. Default is 40.
-min-height integer
The minimum height in pixels of each square. Default is 40.
-max-width integer
The maximum width in pixels of each square. Default is 150.
-max-height integer
The maximum height in pixels of each square. Default is 150.
-max-linewidth integer
The maximum width of the lines used to draw. Default is 25.
-min-linewidth integer
The minimum width of the lines used to draw. Default is 2.
-erase
-no-erase
Whether to clear the screen after each screenful is drawn. Default is True (erase).
-erase-count integer
The number of screenfuls to draw before erasing. Default is 25.
-square
-not-square
Whether to force the tiles to be square. Default is True (square).
-curves
-no-curves
Whether to draw the arc based Truchet pattern. Default is True (curves).
-angles
-no-angles
Whether or not to draw the line based Truchet pattern. Default is True (angles)
-scroll Use the scroll mode. Default is False.
-scroll-overlap
The amount to scroll from one side to another. Default is 400.
-anim-delay
The time to pause between each animation step. Default is 100.
-anim-step-size
The amount of steps to skip between each animation step. Default is 3.
-fps Display the current frame rate and CPU load.
ENVIRONMENT
DISPLAY to get the default host and display number.
XENVIRONMENT
to get the name of a resource file that overrides the global resources stored in the RESOURCE_MANAGER property.
SEE ALSO X(1), xscreensaver(1)COPYRIGHT
Copyright (C) 1998 by Adrian Likins.
Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, pro-
vided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in sup-
porting documentation.
AUTHOR
Adrian Likins, 1998.
X Version 11 5.15 (28-Sep-2011) truchet(6x)