0

I have move ksh script to bash. This script have line which I can't understood:

 pgp -z <pwd> +force $NAME1

Can any one help me to find what means or what it's role in this line? -z option used to pass password into pgp. So possibly could be variable with password. But string pwd is used only once in this script. Maybe it's just redirect or some global variable?

4
  • this doesn't make sense to shell programmers. Are you saying that the ksh code contains the literal string you have quoted, including the <pwd>? don't you mean "$pwd" ? OR is preceded with the comment character #? Good luck. Commented Feb 4, 2016 at 14:50
  • in code it's <pwd> It's not "$pwd", and not comment. The same is used in other places for example db login: user/<pwd>@srv Commented Feb 4, 2016 at 15:15
  • I agree with @Gary_W below, as his answer is the most likely explanation. But does that mean you have never seen the ksh version of this code in use? While it may pass syntax checks, it seems it would generate errors. pgp -z <pwd does make (some) sense, but the following '> +force` would create a file named +force pgp would most likely exit with an error. So figure out how you're going t manage your pswds, (a simple solution is pwd="xyz"; pg -z "$pwd" ...` which is not a good security thing). . . . . Commented Feb 4, 2016 at 15:52
  • Proper security of passwords is a whole different Q, which you should think about before posting your next Q. Good luck. Commented Feb 4, 2016 at 15:53

2 Answers 2

1

I believe it's just a text placeholder for the actual password, meaning "replace me with the actual password when you use this script" or perhaps: "replace me with the actual password when you use this script, if you don't care about security and don't mind hardcoding your password for all to see".

EDIT: Is it possible the script was in the middle of being worked on and the developer had not yet figured out a secure way of supplying the passphrase and just used that for a placeholder in the meantime? I found this interesting description of the -z argument here:

Enter pass phrase on command line
pgp -z "you really shouldn't ought to do this"
Sign up to request clarification or add additional context in comments.

2 Comments

script is finished, and it's working... I starting to thing, that it's used as string - <pwd>. Hours of "googling" don't gives any info.
@Alchazar - Always start with the man page and study the arguments first. I would have to strongly advise against supplying a hardcoded password for security reasons though. Not only is it visible in the script, but I believe it's also visible in the process table via the ps -ef command. Look into alternate methods. as @shelter mentioned, thats a new question.
0

I contacted person, who wrote these scripts and send them to me. It's not password, it's just text. He replaced passwords in all scripts to <pwd>, and forgot to log this in documentation...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.