04-16-2002
a simple perl
not sure if i should post here or "shell programming"
anyway, i am just start learning perl.
1 #!/usr/local/bin/perl
2
3 $test1="Iam";
4 if ($test1=="anything")
5 {
6 print "show me\n";
7 }
when i run the program, it display "show me" all the time regardless the if condition. what is going on here? can any help me?
thks
Gusla
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
why won't below work?
I am trying to see
a)sipfile has username of the system.
b)it will read the sipfile and do a grep function against the /etc/passwd
c)it will save that output to /tmp/result..
but my script is just hanging...
#!/usr/bin/perl -w
open(SIPFILE, "</tmp/sipfile")
... (4 Replies)
Discussion started by: hankooknara
4 Replies
2. Shell Programming and Scripting
hi
i want to write simple socket program which will listen on socket . here is the code
## read msg on socket
#! /usr/bin/perl
use IO::Socket::INET;
my $MySocket= IO::Socket::INET->new(LocalPort=>1234,
Proto=>'udp') ;
while ()... (2 Replies)
Discussion started by: zedex
2 Replies
3. Shell Programming and Scripting
Hi Guys,
If want to change the string "09-06-11" to "11062009", i can only think use split to get the array@, the ,,, then restructure the sequence.
Is there a simple line to do that? :o
Thanks
-----Post Update-----
@file_e_tmp = split('-', $ARGV);
$file_date_e =... (6 Replies)
Discussion started by: jimmy_y
6 Replies
4. Homework & Coursework Questions
I have the following problem, which I need done in Perl/ or Python using Unix/linux filters...
1. You have a very large file, named 'ColCheckMe', tab-delmited, that you are asked to process. You are told that each line in 'ColCheckMe' has 7 columns, and that the values... (1 Reply)
Discussion started by: Swapnilsagarwal
1 Replies
5. Shell Programming and Scripting
I am totally new to perl. I am modifying someone else's script. I have the following output:
# ./some-perlscript
A
B
C
D
E
B - E, is generated through the print command that I put in the script. I want to remove A, it seems it is generated automatically by a custom OS it is querying when... (3 Replies)
Discussion started by: streetfighter2
3 Replies
6. Shell Programming and Scripting
Hi, I am practicing a very simple perl programming, what i want to do is reverse the string
what is wrong with the following
Thanks
$string = "abcdef";
@array = split(//, $string);
$length =length @array
for ( i=1;i< $length+1;i++)
{
print "$_\n";
} (5 Replies)
Discussion started by: ccp
5 Replies
7. Shell Programming and Scripting
Hello All,
I'm trying to run a simple perl script and have the below error. Tried to google it but could not get a precise solution. Could you please help me out.
Can't locate object method "are" via package "equal" (perhaps you forgot to load "equal"?) at ./equal.pl line 9, <STDIN> line 2.
... (3 Replies)
Discussion started by: lovesaikrishna
3 Replies
8. Shell Programming and Scripting
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)
Discussion started by: torchij
16 Replies
9. Shell Programming and Scripting
Hi all
i want a program have input file .txt and process it then got output
Ex:
input:
King Saud University say hi
Mr.Ahmed Cena have a car
perl is good !
Dr.john is good!
output:
KSU say hi
Mr.AC have a car
perl is good!
Dr.John is good!
so the process take the String has... (3 Replies)
Discussion started by: abdulelah252
3 Replies
10. Shell Programming and Scripting
Hello,
I'm completely new to Perl and I'm just looking for a quick answer to some code I'm trying to come up with. I'm trying to access a website, part of the URL I want the user to be able to define via standard input. As you can see below I'm still trying to get the syntax.
... (2 Replies)
Discussion started by: wxornot
2 Replies
LEARN ABOUT CENTOS
gpg-zip
GPG-ZIP(1) GNU Privacy Guard GPG-ZIP(1)
NAME
gpg-zip - Encrypt or sign files into an archive
SYNOPSIS
gpg-zip [options] filename1 [ filename2, ... ] directory1 [ directory2, ... ]
DESCRIPTION
gpg-zip encrypts or signs files into an archive. It is an gpg-ized tar using the same format as used by PGP's PGP Zip.
OPTIONS
gpg-zip understands these options:
--encrypt
-e Encrypt data. This option may be combined with --symmetric (for output that may be decrypted via a secret key or a passphrase).
--decrypt
-d Decrypt data.
--symmetric
-c Encrypt with a symmetric cipher using a passphrase. The default symmetric cipher used is CAST5, but may be chosen with the
--cipher-algo option to gpg.
--sign
-s Make a signature. See gpg.
--recipient user
-r user
Encrypt for user id user. See gpg.
--local-user user
-u user
Use user as the key to sign with. See gpg.
--list-archive
List the contents of the specified archive.
--output file
-o file
Write output to specified file file.
--gpg gpgcmd
Use the specified command gpgcmd instead of gpg.
--gpg-args args
Pass the specified options to gpg.
--tar tarcmd
Use the specified command tarcmd instead of tar.
--tar-args args
Pass the specified options to tar.
--version
Print version of the program and exit.
--help Display a brief help page and exit.
EXAMPLES
Encrypt the contents of directory 'mydocs' for user Bob to file 'test1':
gpg-zip --encrypt --output test1 --gpg-args -r Bob mydocs
List the contents of archive 'test1':
gpg-zip --list-archive test1
DIAGNOSTICS
The program returns 0 if everything was fine, 1 otherwise.
SEE ALSO
gpg(1), tar(1),
The full documentation for this tool is maintained as a Texinfo manual. If GnuPG and the info program are properly installed at your site,
the command
info gnupg
should give you access to the complete manual including a menu structure and an index.
GnuPG 2.0.22 2014-06-10 GPG-ZIP(1)