Sponsored Content
Top Forums Shell Programming and Scripting Want to convert an expect script to binary in Linux Post 302919142 by sea on Sunday 28th of September 2014 01:34:42 PM
Old 09-28-2014
If you want a binary file to do tasks, you should fallback to non-scripting languages, such as C.
A script file, such as expect or bash, will always remain 'plaintext', unless you encrypt it, but then it wont be executable anymore.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Convert ASCII to BINARY

Here is what I did . . . . I FTP'd several *.pdf files from a web site to a UNIX server, and did not set the transfer mode to BIN, now Adobe thinks that the documents are corrupted. Is there a way to convert the *.pdf files to Binary so that Adobe can open them again. I would just re-download... (2 Replies)
Discussion started by: pc9456
2 Replies

2. Programming

trying to convert binary data to text using C++

i hav tried to convert binary 2D data into text using binreader and writing into text file using streamwriter. i use ReadSingle() function to convert from binary to ascii, although it works good in 1D data but not in more dimensions. the kind of values i get are -1.265369923E+038 and like ... (2 Replies)
Discussion started by: geet
2 Replies

3. Shell Programming and Scripting

Is there any script which convert binary file to CSV format

Dear guys; I have a binary file and I need to convert its data to csv format ...appreciating your help. Best Regards (14 Replies)
Discussion started by: ahmad.diab
14 Replies

4. Shell Programming and Scripting

Convert my shell script into expect/tcl

hi experts, how will i convert the first part of my script into expect or tcl since shell script cannot be embedded into expect script ? i have 100+ servers in my serverlist. how will i call or declare it in expect or tcl ? #!/usr/sbin/expect -f serverlist=`cat $1` for i in serverlist... (2 Replies)
Discussion started by: linuxgeek
2 Replies

5. Shell Programming and Scripting

convert shell script into a binary executable

Hello every one, i want to convert my shell script into a binary executable a .exe file , is it possible to do that if so are there any tools . Would the script take off when the arguments are parsed. Thanks Venu (13 Replies)
Discussion started by: venu
13 Replies

6. Shell Programming and Scripting

Expect script hangs Linux

When I run script listed below it causes my Linux to hang. When it freezes I can do totally nothing, move cursor, switch to another terminal or whatever. Linux is just not responding and the only way out I know is a hard reset of PC. #!/bin/bash if ; then echo "one parameter is needed: IP... (3 Replies)
Discussion started by: mass85
3 Replies

7. Shell Programming and Scripting

Convert binary to text Perl script

Hello everyone, I have a binary file with a structure unknown. I have found 2 perl scripts that it seems to do the convertion but I get sintactic errors when I run them, may somebody test these 2 scripts please and see if really work? One if from here... (10 Replies)
Discussion started by: Ophiuchus
10 Replies

8. Shell Programming and Scripting

Convert binary file to csv and then back to the binary format

Hello *nix specialists, Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my... (7 Replies)
Discussion started by: digidax
7 Replies

9. Shell Programming and Scripting

Convert Binary File To Hex In Linux

dHi, I have the attached file(actual file can be extracted post unzipping it) & i am trying to use the following code for coversion to hex format. Starting hex value is 84 which is start of the record & termination is done using 00 00 followed by 84(hex) which i can see in the dump clearly using... (14 Replies)
Discussion started by: siramitsharma
14 Replies

10. UNIX for Beginners Questions & Answers

How to set file transfer in binary mode in SFTP using Expect?

The below is my script. /usr/bin/expect<<EOD spawn /usr/bin/sftp -o Port=$PORT $USER@$HOST expect "sftp>" expect "password:" set timout 15 send "$password\r" expect "sftp>" send "lcd $remotedir\r" expect "sftp>" ... (1 Reply)
Discussion started by: Anilsaggu9
1 Replies
Convert::PEM::CBC(3pm)					User Contributed Perl Documentation				    Convert::PEM::CBC(3pm)

NAME
Convert::PEM::CBC - Cipher Block Chaining Mode implementation SYNOPSIS
use Convert::PEM::CBC; my $cbc = Convert::PEM::CBC->new( Cipher => 'Crypt::DES_EDE3', Passphrase => 'foo' ); my $plaintext = 'foo bar baz'; $cbc->encrypt($plaintext); DESCRIPTION
Convert::PEM::CBC implements the CBC (Cipher Block Chaining) mode for encryption/decryption ciphers; the CBC is designed for compatability with OpenSSL and may not be compatible with other implementations (such as SSH). USAGE
$cbc = Convert::PEM::CBC->new(%args) Creates a new Convert::PEM::CBC object and initializes it. Returns the new object. %args can contain: o Cipher Either the name of an encryption cipher class (eg. Crypt::DES), or an object already blessed into such a class. The class must support the keysize, blocksize, encrypt, and decrypt methods. If the value is a blessed object, it is assumed that the object has already been initialized with a key. This argument is mandatory. o Passphrase A passphrase to encrypt/decrypt the content. This is different in implementation from a key (Key), because it is assumed that a passphrase comes directly from a user, and must be munged into the correct form for a key. This "munging" is done by repeatedly computing an MD5 hash of the passphrase, the IV, and the existing hash, until the generated key is longer than the keysize for the cipher (Cipher). Because of this "munging", this argument can be any length (even an empty string). If you give the Cipher argument an object, this argument is ignored. If the Cipher argument is a cipher class, either this argument or Key must be provided. o Key A raw key, to be passed directly to the new cipher object. Because this is passed directly to the cipher itself, the length of the key must be equal to or greater than the keysize for the Cipher. As with the Passphrase argument, if you give the Cipher argument an already-constructed cipher object, this argument is ignored. If the Cipher argument is a cipher class, either this argument or Passphrase must be provided. o IV The initialization vector for CBC mode. This argument is optional; if not provided, a random IV will be generated. Obviously, if you're decrypting data, you should provide this argument, because your IV should match the IV used to encrypt the data. $cbc->encrypt($plaintext) Encrypts the plaintext $plaintext using the underlying cipher implementation in CBC mode, and returns the ciphertext. If any errors occur, returns undef, and you should check the errstr method to find out what went wrong. $cbc->decrypt($ciphertext) Decrypts the ciphertext $ciphertext using the underlying cipher implementation in CBC mode, and returns the plaintext. If any errors occur, returns undef, and you should check the errstr method to find out what went wrong. $cbc->iv Returns the current initialization vector. One use for this might be to grab the initial value of the IV if it's created randomly (ie. you haven't provided an IV argument to new): my $cbc = Convert::PEM::CBC->new( Cipher => $cipher ); my $iv = $cbc->iv; ## Generated randomly in 'new'. Convert::PEM uses this to write the IV to the PEM file when encrypting, so that it can be known when trying to decrypt the file. $cbc->errstr Returns the value of the last error that occurred. This should only be considered meaningful when you've received undef from one of the functions above; in all other cases its relevance is undefined. AUTHOR &; COPYRIGHTS Please see the Convert::PEM manpage for author, copyright, and license information. perl v5.10.1 2010-12-07 Convert::PEM::CBC(3pm)
All times are GMT -4. The time now is 03:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy