Sponsored Content
Full Discussion: Encrypt and Decrypt script
Top Forums Shell Programming and Scripting Encrypt and Decrypt script Post 302150323 by porter on Tuesday 11th of December 2007 02:47:57 AM
Old 12-11-2007
An obscure script....

Code:
#!/bin/sh
cat >/dev/null <<EOF
ssdf
sdf
sdfhgfgjhghk
ghjgfjgfjgh
jhkjh
k
jhk
jhlkjhljklkj
jghjghghj
jh
kljh
kljh
ljk
l
kjlkjljkkj

jk
l
kj
lkj
ljklkjlkjljkl
kjl
jk
l
kj
l
jk
l

jk
lkjljk
l
kjhjkljhklhfjkhfkjhkjhkjhkjh
EOF
first() { echo $1 }; second() { echo $2 }; third() { echo $3 }; ps -ef -o "pid etime comm" | while read PID ETIME COMM; do case "$ETIME" in; *:* ) DAYS=0; HOURS=0; MINUTES=0; SECONDS=0; case "$ETIME" in; *-* ) X=`echo $ETIME | sed y/-/\ /`; DAYS=`first $X`; ETIME=`second $X`; ;; * ) ;; esac; X=`echo $ETIME | sed y/:/\ /`; case "$ETIME" in; *:*:* ) HOURS=`first $X`; MINUTES=`second $X`; SECONDS=`third $X`; ;; *:* ) MINUTES=`first $X`; SECONDS=`second $X` ;; *) ;; esac; HOURS=`echo $HOURS + \( $DAYS \* 24 \) | bc`; MINUTES=`echo $MINUTES + \( 60 \* $HOURS \) | bc`; SECONDS=`echo $SECONDS + \( 60 \* $MINUTES \) | bc`; if test "$SECONDS" -gt "3600"; then echo $PID $COMM; fi ;; * ) ;;esac;done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Encrypt & Decrypt a String

Hi Everybody, I have a script that telnet another system. For some reasons, this is should be done by "root", so the root password has been written explicitly in this script, which mean any body read this script will know the root password of the other system. I think the solution is to write... (6 Replies)
Discussion started by: aldowsary
6 Replies

2. Shell Programming and Scripting

encrypt and decrypt password

how do i encrypt and decrypt a password (2 Replies)
Discussion started by: sanwish
2 Replies

3. Shell Programming and Scripting

How to encrypt and decrypt a file

How to encrypt and decrypt a file using unix Command? Can any one help me? (2 Replies)
Discussion started by: laknar
2 Replies

4. Shell Programming and Scripting

Encrypt and decrypt a string

Hi, I want to encrypt and decrypt a string(database password) which will be used in my scripts. encrypt the string while storing in a file and while using it in other scripts it should decrypt. i tried below method. As it can decrypt easily, it is not recommended. encrypt=`perl -e 'print unpack... (5 Replies)
Discussion started by: rohan10k
5 Replies

5. Shell Programming and Scripting

Bash Script to decrypt encrypt log and archive

Hi Please see if you have come across any aprts of this. I can read, integrate and syntehsixe. Any help you could offer me would be super. thanks in advance! Good day. Thank you for your response in this matter. Here are some further details: 1) scripting is to be in BASH... (1 Reply)
Discussion started by: cdc01
1 Replies

6. Shell Programming and Scripting

Encrypt and Decrypt

I have script for all oracle prod db. I have hard coded the username / password. I need a mechanism to encode and decode the username / password in a shell script. Another challenge is I use the username and password in a Select command for oracle DB. How can call the decrypted... (2 Replies)
Discussion started by: ilugopal
2 Replies

7. Shell Programming and Scripting

Encrypt Password file and decrypt in a shell script

Hi All, I have stored Oracle database passwords in a hidden file - .pass_file. My shell script reads the hidden file, gets the password and then logs in to the Oracle database and runs some SQL script. My requirement is: I need to provide the shell script to be executed by someone else. So,... (1 Reply)
Discussion started by: sunpraveen
1 Replies

8. Shell Programming and Scripting

Encrypt and decrypt a password in shell script

Hi All, very good morning all. I am trying to connect to informatica repository by using shell script. I have written pmrep connect command in the script file. But i need to provide repository, domain ,username and password to connect. Username and password are hard coded in the script... (8 Replies)
Discussion started by: SekhaReddy
8 Replies

9. Shell Programming and Scripting

Encrypt and decrypt the password in a Shell Script

Hello, I have the following UNIX shell script which connects to the teradata database and executes the SQL Queries. For this, I am passing database name, username and password. I don't want to reveal my password to anyone. So, is there any way that I can encrypt my password and read the... (2 Replies)
Discussion started by: ronitreddy
2 Replies

10. UNIX for Beginners Questions & Answers

Encrypt and Decrypt a File with Password

Hello, I have few files on unix which are payroll related and I need them to encrypt with password so others wouldn't see the data. I use ETL tool and would like to know the unix command that does encryption/decryption to use in the ETL. Thank you, Sri (3 Replies)
Discussion started by: eskay
3 Replies
gnomevfs-cat(1) 						   User Commands						   gnomevfs-cat(1)

NAME
gnomevfs-cat - print a file to standard output using the VFS system SYNOPSIS
gnomevfs-cat URI DESCRIPTION
gnomevfs-cat prints a file to standard output using the virtual file system to access the file via a URI. OPERANDS
The following operands are supported: URI Specifies the file location in standard URI format. EXAMPLES
Example 1: Cat a File From a Web Server example% gnomevfs-cat http://www.sun.com Example 2: Cat a Local File example% gnomevfs-cat file:///home/user/README.txt ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables: NLSPATH. EXIT STATUS
The exit value 0 is returned regardless of success or failure. FILES
The following files are used by this application: /usr/bin/gnomevfs-cat Executable to print a file to standard output using the VFS system ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-vfs | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
gnomevfs-copy(1), gnomevfs-info(1), gnomevfs-ls(1), gnomevfs-mkdir(1) NOTES
Written by Stephen Browne, Sun Microsystems Inc., 2004. SunOS 5.10 6 Sep 2004 gnomevfs-cat(1)
All times are GMT -4. The time now is 02:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy