Does anyone know how to convert this bash shell script to perl?
for i in `ls -l *pgp`
do
`usr/bin/gpg --passphrase-fd 0 $i < .sunspot`
done
Thanks! Any help would be appreciated. I'm new to Linux and perl. (4 Replies)
I have a perl code that runs like
Code I
sub p
{
if ($d >= $D) {return}
printf "%3s"x$d++," ";
printf "%s%s\n",$_,$h{$_}?" ** ":"";
if (!$h{$_})
{
$h{$_}=1;
map {p($_)} @{$s{$_}}
}
$d--
}
($Set,$Job,$Num,$D) = (@ARGV);
map {shift} 0..3; (8 Replies)
Hi,
I need convert a date string to date.
For eaxmple
$last_date=6/2/2009
and I want to change the format of the above mentioned date to "Jun 2 2009 12:00AM".
Do we have any functionality or staright method to convert to the desired format? (4 Replies)
Hello,
I have an AIX 5.3 system and i created a script to get the last login of users.
The script goes like this:
LAST_LOGIN=`lsuser -a time_last_login $cur_user`
TIME_LOGIN=`perl -e 'print scalar localtime("$LAST_LOGIN")'`
Actually what i do in these two lines is to set a variable... (2 Replies)
Hello all!
This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician.
Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix:
... (16 Replies)
Suppose
file1.bim
1 rs1 0 0 G A
1 rs3 0 1 A C
2 rs8 0 0 G A
2 rs2 0 0 T C
3 rs10 0 0 0 T
3 rs11 0 0 T 0
(N*6 table, where N is arbitary,in this case 6, where 2nd column is the name of SNP, and the 5th,6th are genotype data, where 0 means missing information)
There is... (9 Replies)
I am working on converting shell to Perl script. In shell we have built in function
trap
Do you know alternative in Perl or actually we don't need it?
Thanks for contribution (3 Replies)
Hello. I'm trying to convert an awk script I wrote to perl (which I just started self-teaching). I tried the a2p command but I couldn't make sense of most of it.
Here was the awk code:
BEGIN{
FS = ","
print "NAME\tLOW\tHIGH\tAVERAGE"
a=0
}
{
if(a==0){
a+=1 (1 Reply)
Hello. I'm currently teaching myself Perl and was trying to turn an awk code that I had written into Perl. I have gotten stuck on a particular part and a2p has not helped me at all. The task was to take a .csv file containing a name, assignment type, score and points possible and compute it into a... (1 Reply)
Discussion started by: Eric7giants
1 Replies
LEARN ABOUT DEBIAN
numconv
NUMCONV(1) User Commands NUMCONV(1)NAME
numconv - convert numbers from one number system to another
SYNOPSIS
Numconv <options>
DESCRIPTION
numconv is a filter that converts integers from one number system to another. For example, it can convert from Roman Numerals such as
"CCLVI" to ordinary Western numbers such as "256" or from Western numbers to Chinese. The great majority of number systems, both modern
and ancient, are supported, including numerous variants.
If the input number system is 'all', the number system will be autodetected.
numconv is a command line interface to libuninum a library for converting between textual representations of numbers and machine-internal
representations. Further information about the conversions performed is available in the documentation for this library.
OPTIONS -i <input file>
Read input from the specified file.
-o <output file>
Write output into the specified file.
-I Identify the number system of the input.
-c List the available number system cover terms.
-l List the available number systems.
-f <input number system>
Specify the number system of the input.
-t <output number system>
Specify the number system of the output.
-b <input base>
Specify the input base for Western numbers. The base must be in the range [1,36].
-B <output base>
Specify the output base for Western numbers. The base must be in the range [1,36].
-g <output general group size>
Specify the size of digit groups other than the ow-order group. The default is 3.
-G <output low group size>
Specify the size of the low-order group of digits. The default is 3.
-s <output group separator character>
Specify character to use as "thousands separator". The default is a comma.
-L Set the output grouping parameters, general group size, first group size, and group separator character, according to the current
locale.
-m When generating Roman numerals, use unit characters with superscript macron for thousands greater than one instead of Ms.
-h Print help information.
-v Print version information.
EXAMPLES
To convert from Roman Numerals to ordinary Western numbers:
numconv -f Roman -t Western_Lower
To convert from ordinary Western numbers to the variety of number in current use in the People's Republic of China:
numconv -f Western -t Mandarin_Regular_Simplified
To convert from ordinary Western numbers to Western numbers in base 2:
numconv -f Western_Lower -t Western_Lower -B 2
To convert from Urdu numbers to Hindi numbers with the traditional Indian grouping:
numconv -f Perso_Arabic -t Devanagari -g 2
SEE ALSO
libuninum (3)
AUTHOR
Bill Poser (billposer@alum.mit.edu)
LICENSE
GNU General Public License, version 2. (http://www.gnu.org/licenses/gpl.txt)
numconv September 2007 NUMCONV(1)