10 More Discussions You Might Find Interesting
1. Programming
Basically my problem is that when I try to compile anything using ./configure && make, it fails because of linker errors. I can reproduce the behavior I'm getting as follows:
I have the two following files
main.c:
#include <stdio.h>
extern void func(void);
int
main(int argc, char... (5 Replies)
Discussion started by: MarshallBanana
5 Replies
2. Shell Programming and Scripting
I have 2 txt files, 1.txt and 2.txt which contain the paths to files that need to be linked.
Example 1.txt:
/root/001/folder2/image4.nii.gz
/root/002/folder2/image4.nii.gz
Example 2.txt:
/root/001/folder2/image5.nii.gz
/root/002/folder2/image5.nii.gz
Each line represents images from... (7 Replies)
Discussion started by: LeftoverStew
7 Replies
3. Shell Programming and Scripting
I would like to transfer all files ending with .log from /tmp and to /tmp/archive (using find )
The directory structure looks like :-
/tmp
a.log
b.log
c.log
/abcd
d.log
e.log
When I tried the following command , it movies all the log files... (8 Replies)
Discussion started by: frintocf
8 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have d1,d2,d3 directories
/
/home/abc/d1
/home/abc/d2
/home/abc/d3
d1,d2 and d3 also have subdirctories.
d1-->d11-->d12
d2-->d22-->d23
d3-->d33-->d34
All these directories have files like date_filename.txt
so I want to find the files recusively for a particular date from... (1 Reply)
Discussion started by: jagadish_gaddam
1 Replies
5. UNIX for Advanced & Expert Users
I have a directory containing a series of files of the format:
A2008001231000.L2
I only care about the 6-8 digits, so the files are effectively:
?????---*.L2
I have files that range from ?????001*.L2 to ?????366*.L2
It should be noted these three digits represent the julian day of the... (2 Replies)
Discussion started by: msb65
2 Replies
6. Programming
Dear friends,
First off all , let me apologize for my inexperience. I am just starting use of Linux and gcc .
Actually I ve some .c files in the present directory , and now I am
giving
+vc <my_file1.c> <my.file2.c> <myfile3.c>.
All the c files are in present directory.... (2 Replies)
Discussion started by: user_prady
2 Replies
7. UNIX for Dummies Questions & Answers
Hello,
Can anyone tell me how I can make a file link or shortcut in UNIX 4.0, several
file links where damaged during an outage examples below.
Examples: file -> file
libX11.so -> /usr/shlib/libX11.so.pre.O3D
All of the file links that were damaged were in /shlib and point to... (3 Replies)
Discussion started by: jays337
3 Replies
8. UNIX for Dummies Questions & Answers
hi,
This is the first time I work in a big C project. All source code files are located in say directory /source/pp and all header files are in /include/pp. I've created a link to both of these directories from my home dir, say /home/ss. So in the /home/ss dir I have the /source/pp and /include/pp... (1 Reply)
Discussion started by: bruins2005
1 Replies
9. Programming
Hi
I'm getting
ld: fatal: option -h and building a dynamic executable are incompatible
ld: fatal: Flags processing errors
When I run
ld -shared -L/usr/dt/lib -lDtSvc -o builtin.so Workspace.o
after running
gcc -fPIC -I/usr/X11R6/include -I/usr/dt/include -c Workspace.c
I'm... (6 Replies)
Discussion started by: laho
6 Replies
10. Programming
Hi mates,
I am trying to copile and link to C programs with command:
cc file1,file2
but i raises the error "file not found" ... am i doing the right way?
any suggestion will be appreciated.
thanks
abdul (4 Replies)
Discussion started by: abdul
4 Replies
Text::Trim(3pm) User Contributed Perl Documentation Text::Trim(3pm)
NAME
Text::Trim - remove leading and/or trailing whitespace from strings
VERSION
version 1.02
SYNOPSIS
use Text::Trim;
$text = " important data
";
$data = trim $text;
# now $data contains "important data" and $text is unchanged
# or:
trim $text; # work in-place, $text now contains "important data"
@lines = <STDIN>;
rtrim @lines; # remove trailing whitespace from all lines
# Alternatively:
@lines = rtrim <STDIN>;
# Or even:
while (<STDIN>) {
trim; # Change $_ in place
# ...
}
DESCRIPTION
This module provides functions for removing leading and/or trailing whitespace from strings. It is basically a wrapper around some simple
regexes with a flexible context-based interface.
EXPORTS
All functions are exported by default.
CONTEXT HANDLING
void context
Functions called in void context change their arguments in-place
trim(@strings); # All strings in @strings are trimmed in-place
ltrim($text); # remove leading whitespace on $text
rtrim; # remove trailing whitespace on $_
No changes are made to arguments in non-void contexts.
list context
Values passed in are changed and returned without affecting the originals.
@result = trim(@strings); # @strings is unchanged
@result = rtrim; # @result contains rtrimmed $_
($result) = ltrim(@strings); # like $result = ltrim($strings[0]);
scalar context
As list context but multiple arguments are stringified before being returned. Single arguments are unaffected. This means that under
these circumstances, the value of $" ($LIST_SEPARATOR) is used to join the values. If you don't want this, make sure you only use single
arguments when calling in scalar context.
@strings = (" hello
", " there
");
$trimmed = trim(@strings);
# $trimmed = "hello there"
local $" = ', ';
$trimmed = trim(@strings);
# Now $trimmed = "hello, there"
$trimmed = rtrim;
# $trimmed = $_ minus trailing whitespace
Undefined values
If any of the functions are called with undefined values, the behaviour is in general to pass them through unchanged. When stringifying a
list (calling in scalar context with multiple arguments) undefined elements are excluded, but if all elements are undefined then the return
value is also undefined.
$foo = trim(undef); # $foo is undefined
$foo = trim(undef, undef); # $foo is undefined
@foo = trim(undef, undef); # @foo contains 2 undefined values
trim(@foo) # @foo still contains 2 undefined values
$foo = trim('', undef); # $foo is ''
FUNCTIONS
trim
Removes leading and trailing whitespace from all arguments, or $_ if none are provided.
rtrim
Like trim() but removes only trailing (right) whitespace.
ltrim
Like trim() but removes only leading (left) whitespace.
UNICODE
Because this module is implemented using perl regular expressions, it is capable of recognising and removing unicode whitespace characters
(such as non-breaking spaces) from scalars with the utf8 flag on. See Encode for details about the utf8 flag.
Note that this only applies in the case of perl versions after 5.8.0 or so.
SEE ALSO
Brent B. Powers' String::Strip performs a similar function in XS.
AUTHOR
Matt Lawrence <mattlaw@cpan.org>
ACKNOWLEDGEMENTS
Terrence Brannon <metaperl@gmail.com> for bringing my attention to String::Strip and suggesting documentation changes.
perl v5.10.1 2010-06-07 Text::Trim(3pm)