10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
Hi I have a code like this:
sub WriteEbcdicHeader
{
my $Htimestamp=localtime();#i need to pack and unpack this
my $eheaderline = $Htimestamp;
#packing has to be done here
#unpacking has to be done after packing
print $EOUTFILE
return $eheaderline;
}
sub WriteEbcdicTrailer
{
... (5 Replies)
Discussion started by: rbathena
5 Replies
3. UNIX for Dummies Questions & Answers
I am using pack/unpack to encyrpt a file.
syntax is below
#!/bin/sh
encrypt=`perl -e 'print unpack "H*","yourpassword"'` -
echo $encrypt >/file/to/store/encrypted/password
pass=`cat /file/to/store/encrypted/password`
decrypt=`perl -e 'print pack "H*",$pass'` ... (2 Replies)
Discussion started by: erinlomo
2 Replies
4. Shell Programming and Scripting
In Perl I can write a condition that evaluates a match expression like this:
if ($foo =~ /^bar/) {
do blah blah blah
}
How do I write this in shell? What I need to know is what operator do I use? The '=~' doesn't seem to fit. I've tried different operators, I browsed the man page for... (3 Replies)
Discussion started by: indiana_tas
3 Replies
5. Shell Programming and Scripting
Is it possible to invoke a perl function from a bash script ?
There are existing perl scripts with many functions that I want to reuse from a more recent script written in bash. Hence the question. (1 Reply)
Discussion started by: NewDeb
1 Replies
6. UNIX for Dummies Questions & Answers
I have a file that contains user id and corresponding password.
Lets say password is "help". The below command will create a hex value for string "help".
perl -e 'print unpack "H*","help"'
So now password is in encoded format.
Then I decoded it in the script where am fetching the... (1 Reply)
Discussion started by: max_payne1234
1 Replies
7. Shell Programming and Scripting
Hi! I'm doing bash shell scripting and would like to know if bash had something similar to perl's split function? Ultimately, I want to split two strings (delimeter = '.') and compare each of their values. Thus, I figured putting them in an array would be easiest.
So i.e.:
String 1:... (5 Replies)
Discussion started by: eur0dad
5 Replies
8. Programming
what is the equivalent function for wherey( ) ?? That is to return the current column position? (2 Replies)
Discussion started by: rockgal
2 Replies
9. Shell Programming and Scripting
Hello everyone.
I wrote a perl script to get the two answers from a value: x.
By this, I want to do sqrt($x) in different precision.
#!/usr/bin/perl
print "Input the initial value x:\n";
chomp($x=<STDIN>);
$comp=sqrt($x);
$float_value=pack("f", $comp);
$double_value=pack("d", $comp);... (2 Replies)
Discussion started by: Euler04
2 Replies
10. Shell Programming and Scripting
ok guys and gals at the moment i am perplexed (prolly cuz i been looking at it to long) but here it is.
OS: sol8
perlver: 5.8.0
shell: ksh
answer must be in perl!!
issue:
when i use pack() it packs the data at the front of the requested field space. normally it wouldnt be a problem if... (1 Reply)
Discussion started by: Optimus_P
1 Replies