05-07-2010
${STRING%SUBSTRING} removes SUBSTRING from the end of STRING
\n : the \ must be escaped by \ so thats why i wrote \\n
This User Gave Thanks to frans For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
What is the differnece between chomp and chop in perl? (1 Reply)
Discussion started by: seismic_willy
1 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I would like to know given that i have two columns and I would like to take the positive integer of the differences between the two columns.
which means |3-2|=1; |2-3|=1 as well.
I would like to know do Bash recognize | | as well for this purposes?
Thanks.
-Jason (2 Replies)
Discussion started by: ahjiefreak
2 Replies
3. Shell Programming and Scripting
When reading over some perl code in a software document, I came across an assignment statement like this
$PATH = ${PROJECT}/......./....
In this particular form of scalar variable assignment, what does the curly braces operators do ? Also, what is the benefit in doing scalar assignment this... (3 Replies)
Discussion started by: JamesGoh
3 Replies
4. Shell Programming and Scripting
Hello:
I have the following perl script which is giving me trouble inside the second elsif statement. The purpose of the script is to go through a file and print out only those lines which contain pertinent information. The tricky part came when I realized that certain items actually spanned... (5 Replies)
Discussion started by: erichpowell
5 Replies
5. Shell Programming and Scripting
I'm almost pulling out my hair trying to figure out what's wrong with this... there's no reason I can see that it shouldn't be working. It seems that the code acts as though the conditional statement is true no matter what - I've even tried removing the negation operator, but it always goes into... (5 Replies)
Discussion started by: wildbluefaerie
5 Replies
6. Shell Programming and Scripting
I know that when using 'while (<FILE>) {}', Perl reads only one line of the file at one time, and store it in '$_'.
Can I change some parameters so that 'while (<>) {}' can read more than one lines, like 2 or 5 lines at one time?
Thanks for the help! (1 Reply)
Discussion started by: zx1106
1 Replies
7. Shell Programming and Scripting
Hello,
I am not sure, where I am missing in the scirpt, I am trying to grep few users from /etc/passwd file and if exists, I added line to echo as user exist, if not create it.
#!/bin/bash
for vid in v707 z307 z496 z163 z292 ; do
if
then
echo " $vid User exists "
else
... (2 Replies)
Discussion started by: bobby320
2 Replies
8. Shell Programming and Scripting
Hello All,
Alright, so this is driving me absolutely insane. I can't seem to find this ANYWHERE...
I've tried every combination and synonym I can think of for this trying to search Google.
What is the Expect/Tcl equivalent to Perl and Bash's "=~" operator, (i.e. the "contains" operator).... (2 Replies)
Discussion started by: mrm5102
2 Replies
9. Shell Programming and Scripting
Hello, can you please help me because I am totally confused with a simple script:
#!/bin/bash
] || ] && echo "Good Morning"
] || ] && echo "Good Night"
For me, these two strings are indentical: false || false and there is no point to execute echo command.
But the run result is... (5 Replies)
Discussion started by: AndreiM
5 Replies
10. Shell Programming and Scripting
I have a little code block (executing on AIX 7.1) that I cannot understand why the NOTFREE=0 does not appear to be assigned even though it goes through that block. This causes a unary operator issue.
#!/bin/bash
PLATFORM="AIX"
NEEDSPC=3000
set -x
if ; then
lsvg | grep -v rootvg | while... (6 Replies)
Discussion started by: port43
6 Replies
LEARN ABOUT DEBIAN
tk::clipboard
Clipboard(3pm) User Contributed Perl Documentation Clipboard(3pm)
NAME
Tk::clipboard - Manipulate Tk clipboard
SYNOPSIS
$widget->clipboardOption?(args)?
DESCRIPTION
This command provides an interface to the Tk clipboard, which stores data for later retrieval using the selection mechanism. In order to
copy data into the clipboard, clipboardClear must be called, followed by a sequence of one or more calls to clipboardAppend. To ensure
that the clipboard is updated atomically, all appends should be completed before returning to the event loop.
The following methods are currently supported:
$widget->clipboardClear
Claims ownership of the clipboard on $widget's display and removes any previous contents. Returns an empty string.
$widget->clipboardAppend(?-format=>format?,?-type=>type?,?--?,data)
Appends data to the clipboard on $widget's display in the form given by type with the representation given by format and claims
ownership of the clipboard on $widget's display.
Type specifies the form in which the selection is to be returned (the desired ``target'' for conversion, in ICCCM terminology), and
should be an atom name such as STRING or FILE_NAME; see the Inter-Client Communication Conventions Manual for complete details.
Type defaults to STRING.
The format argument specifies the representation that should be used to transmit the selection to the requester (the second column
of Table 2 of the ICCCM), and defaults to STRING. If format is STRING, the selection is transmitted as 8-bit ASCII characters.
See the Tk::Selection documentation for explanation of what happens if format is not STRING. Note that arguments passed to
clipboardAppend are concatenated before conversion, so the caller must take care to ensure appropriate spacing across string
boundaries. All items appended to the clipboard with the same type must have the same format.
A -- argument may be specified to mark the end of options: the next argument will always be used as data. This feature may be
convenient if, for example, data starts with a -.
$widget->clipboardGet( ?-type? );
Retrieve data from the clipboard on widget's display. -type specifies the form in which the data is to be returned and should be an
atom name such as STRING or FILE_NAME. Type defaults to STRING. This command is equivalent to "SelectionGet( -selection =>
'CLIPBOARD' )".
KEYWORDS
clear, format, clipboard, append, selection, type
perl v5.14.2 2010-05-29 Clipboard(3pm)