Sponsored Content
Top Forums Shell Programming and Scripting Dollar symbol in Shell Script Variable Post 303003804 by RudiC on Thursday 21st of September 2017 02:57:34 AM
Old 09-21-2017
Are you sure you're running pgp with the correct passphrase when using the "hardcoded" one? With what you showed in post#4, wouldn't it look like
Code:
{ read; while read lvbank recipient signer passphrase REST; do echo pgp -es $SourceFile --Recipient $recipient  --signer $signer --passphrase "abc$123" --output $EncryptFile; done; } < file
pgp -es --Recipient 0X12343 --signer 0x1234 --passphrase abc23 --output

because it expands the $1 positional parameter (which is empty) as opposed to
Code:
{ read; while read lvbank recipient signer passphrase REST; do echo pgp -es $SourceFile --Recipient $recipient  --signer $signer --passphrase $passphrase --output $EncryptFile; done; } < file
pgp -es --Recipient 0X12343 --signer 0x1234 --passphrase abc$123 --output

See the difference?
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Registered Symbol in Korn Shell script

When I am trying to write this symbol in shell script ( ® ) I am getting a . ( dot ) instead , does anybody know how to fix it. Thanks. (1 Reply)
Discussion started by: jacki
1 Replies

2. Shell Programming and Scripting

direction symbol in a variable as part of the command

Hi, How can I get this to work? #!/bin/ksh if ; then direction=">>" else direction=">" fi cat some_file_name $direction temp.txt exit This shell script is not happy with using "$direction" opposed to ">" or ">>". Thanks. (5 Replies)
Discussion started by: peterloo
5 Replies

3. Shell Programming and Scripting

How to type the Omega symbol Ω in unix shell script

Hi, I have a data file delimited by Ω symbol, I would like to use this in grep and cut command. but How to type this Omega symbol. Thanks Murugesan (1 Reply)
Discussion started by: NagaMurugesan
1 Replies

4. Shell Programming and Scripting

Expect Script square bracket dollar prompt

Hi Thanks for this amazing forum first, I've been searching answers in it for problems that I've encountered at work. The only problem I haven't been able to find a fix for, is a ever waiting for prompt problem in Expect when encounter a $ prompt. I usually set the timeout to -1 cause the... (2 Replies)
Discussion started by: Ikaro0
2 Replies

5. Shell Programming and Scripting

assign awk's variable to shell script's variable?

Dear All, we have a command output which looks like : Total 200 queues in 30000 Kbytes and we're going to get "200" and "30000" for further process. currently, i'm using : numA=echo $OUTPUT | awk '{print $2}' numB=echo $OUTPUT | awk '{print $5}' my question is : can I use just one... (4 Replies)
Discussion started by: tiger2000
4 Replies

6. Shell Programming and Scripting

how to remove the target of the symbol link in a shell script

I have a target directory, there are some files and directories in "target_dir". I have a symbol link: my_link -> <target_dir> The target directory name is NOT known to the script (because it is varying), while the link name is always fixed. In a shell script, how to remove both the... (1 Reply)
Discussion started by: princelinux
1 Replies

7. Shell Programming and Scripting

[Solved] cp command with dollar variable in ksh

hi, I have been trying to acheive the following task for a while now, but failed.. Need help, experts please help! This is what I am trying to do: - I am writing to a flat file the name of the source to be copied and the destination path as to where it is to be copied to. Sample flat file:... (7 Replies)
Discussion started by: abdulhusein
7 Replies

8. Shell Programming and Scripting

$ symbol in sql query in shell script

Hi Team, Can you please help me to resolve this issue. Am unable to use this $ symbol in sql query in the shell script. For Example: # !/bin/sh export USER_NAME=XXX export PASSWORD=YYY export ORACLE_SID=xamdb echo $ORACLE_SID echo " Session Details ..." ... (1 Reply)
Discussion started by: indira_s
1 Replies

9. Shell Programming and Scripting

Unable to pass shell script variable to awk command in same shell script

I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist. diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies

10. UNIX for Beginners Questions & Answers

How can I assign awk's variable to shell script's variable?

I have the following script, and I want to assign the output ($10 and $5) from awk to N and L: grdinfo data.grd | awk '{print $10,$5}'| read N L output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Discussion started by: geomarine
8 Replies
Mail::DKIM::SignerPolicy(3)				User Contributed Perl Documentation			       Mail::DKIM::SignerPolicy(3)

NAME
Mail::DKIM::SignerPolicy - determines signing parameters for a message DESCRIPTION
A "signer policy" is an object, class, or function used by Mail::DKIM::Signer to determine what signatures to add to the current message. To take advantage of signer policies, create your own Perl class that extends the Mail::DKIM::SignerPolicy class. The only method you need to implement is the apply() method. The apply() method takes as a parameter the Mail::DKIM::Signer object. Using this object, it can determine some properties of the message (e.g. what the From: address or Sender: address is). Then it sets various signer properties as desired. The apply() method should return a nonzero value if the message should be signed. If a false value is returned, then the message is "skipped" (i.e. not signed). Here is an example of a policy that always returns the same values: package MySignerPolicy; use base "Mail::DKIM::SignerPolicy"; sub apply { my $self = shift; my $signer = shift; $signer->algorithm("rsa-sha1"); $signer->method("relaxed"); $signer->domain("example.org"); $signer->selector("selector1"); $signer->key_file("private.key"); return 1; } To use this policy, simply specify the name of the class as the Policy parameter... my $dkim = Mail::DKIM::Signer->new( Policy => "MySignerPolicy", ); ADVANCED
You can also have the policy actually build the signature for the Signer to use. To do this, call the signer's add_signature() method from within your apply() callback. E.g., sub apply { my $self = shift; my $signer = shift; $signer->add_signature( new Mail::DKIM::Signature( Algorithm => $signer->algorithm, Method => $signer->method, Headers => $signer->headers, Domain => $signer->domain, Selector => $signer->selector, )); return; } Again, if you do not want any signatures, return zero or undef. If you use add_signature() to create a signature, the default signature will not be created, even if you return nonzero. AUTHOR
Jason Long, <jlong@messiah.edu> COPYRIGHT AND LICENSE
Copyright (C) 2006-2007 by Messiah College This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available. perl v5.18.2 2012-11-28 Mail::DKIM::SignerPolicy(3)
All times are GMT -4. The time now is 06:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy