Sponsored Content
Top Forums Shell Programming and Scripting Can someone please explain what tr#A-Za-z0-9+/# -_#; means in perl? Post 302466963 by jim mcnamara on Wednesday 27th of October 2010 08:06:23 PM
Old 10-27-2010
prolly not.
Code:
tr#A-Za-z0-9+/# -_#;

== turn an alphanumeric string (if that is something you know) into '-_' where _
is a reserved word in perl regex that means a word separator. i.e., replace alphanum words
witj the hyphen
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl doubt plz explain....

hi all i wrote a shell script which uses perl script my code is : >cat filename | while read i >do >perl -e 'require "/home/scripts/abc.pl" ; abc("$i")' >done perl script used will simply check syntax of Cobol programs but it didn't work for me so i asked my colleague he suggested... (1 Reply)
Discussion started by: zedex
1 Replies

2. UNIX for Advanced & Expert Users

perl explain syntax !!!

hi all i was going through some perl code i came across this line and i am not getting what is exactly going on .. $$this{localtion} = GetName->GetVarName("EXE_DIR") ; what is the red part doing in above code (2 Replies)
Discussion started by: zedex
2 Replies

3. Shell Programming and Scripting

perl: Please explain this for me: $hexdigit = (0 .. 9, 'a' .. 'f')[$num & 15];

This is taken from perlop. I can't understand what's going on, please can someone explain this for me? $hexdigit = (0 .. 9, 'a' .. 'f'); to get a hexadecimal digit (2 Replies)
Discussion started by: ksheller
2 Replies

4. Programming

What does it means?

#define abc '\xE8' (7 Replies)
Discussion started by: kamlesh33
7 Replies

5. UNIX for Advanced & Expert Users

What does "__FD_PRN_" means in perl code ?

I have seen something like this in a perl code: $_ =~ s/__FD_PRN_/\\(/g What does this "__FD_PRN_" means. I have searched google but was not able to find any info regarding this. Appreciate if some one can refer to a link for these characters. From comments/code it used to substitue "(" with... (3 Replies)
Discussion started by: sarbjit
3 Replies

6. UNIX for Dummies Questions & Answers

Explain perl formatting commands

Could you please tell the meaning of Below mentioned perl script lines: format OWNER_TOTAL = @< Owner Code @<<<<<<total: @#######.## @#######.## @#######.## @#######.## @#######.## @#######.## @#######.## @#######.## @#######.## @#######.## @###### #.## $prev_cust_type, $prev_owner_code,... (2 Replies)
Discussion started by: vinothrajan55
2 Replies

7. Shell Programming and Scripting

can you explain this perl command?

I am using this line of perl code to change the file format and remove ^M at the end of each line in files: perl -i -pe's/\r$//;' <name of file here> Can you explain to me what this code does, and translate it into bash/awk/sed? (2 Replies)
Discussion started by: locoroco
2 Replies

8. UNIX for Beginners Questions & Answers

Perl: Can someone please explain this code "sort { $a <=> $b } @unsorted"

@sorted = sort { $a <=> $b } @unsorted; I am having hard time understanding how this works? I know the output but interested to know the working. Thanks in advance. (2 Replies)
Discussion started by: Tanu
2 Replies

9. UNIX for Beginners Questions & Answers

Perl/Array Sorting : Can someone please explain below code $h{$_}++

sub uniq { my %h; return grep { !$h{$_}++ } @_ } The above code is to remove duplicates from array. I am having hard time understanding below things (basically around highlighted code in bold)- when was the value inserted in hash? and are we only adding a key in Hash not... (1 Reply)
Discussion started by: Tanu
1 Replies
LOOK(1) 						    BSD General Commands Manual 						   LOOK(1)

NAME
look -- display lines beginning with a given string SYNOPSIS
look [-bdf] [-t termchar] string [file ...] DESCRIPTION
The look utility displays any lines in file which contain string as a prefix. If file is not specified, the file /usr/share/dict/words is used, only alphanumeric characters are compared and the case of alphabetic char- acters is ignored. The following options are available: -b, --binary Use a binary search on the given word list. If you are ignoring case with -f or ignoring non-alphanumeric characters with -d, the file must be sorted in the same way. Please note that these options are the default if no filename is given. See sort(1) for more information on sorting files. -d, --alphanum Dictionary character set and order, i.e., only alphanumeric characters are compared. -f, --ignore-case Ignore the case of alphabetic characters. -t, --terminate termchar Specify a string termination character, i.e., only the characters in string up to and including the first occurrence of termchar are compared. ENVIRONMENT
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of the look utility. Their effect is described in environ(7). FILES
/usr/share/dict/words the dictionary EXIT STATUS
The look utility exits 0 if one or more lines were found and displayed, 1 if no lines were found, and >1 if an error occurred. COMPATIBILITY
The original manual page stated that tabs and blank characters participated in comparisons when the -d option was specified. This was incor- rect and the current man page matches the historic implementation. look uses a linear search by default instead of a binary search, which is what most other implementations use by default. The -a and --alternative flags are ignored for compatibility. SEE ALSO
grep(1), sort(1) HISTORY
A look utility appeared in Version 7 AT&T UNIX. BUGS
Lines are not compared according to the current locale's collating order. Input files must be sorted with LC_COLLATE set to 'C'. BSD
July 17, 2004 BSD
All times are GMT -4. The time now is 12:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy