Sponsored Content
Top Forums Shell Programming and Scripting Printf or any other method to put long string of spec characters - passing passwords Post 303007258 by elxa1 on Tuesday 14th of November 2017 02:18:28 PM
Old 11-14-2017
Printf or any other method to put long string of spec characters - passing passwords

Hello,

I am looking for a method to use in my bash script which allows me to use long strings with all special characters.

I have found that printf method could be helpful for me but unfortunately, when I trying
Code:
root@machine:~# tevar=`printf "%s%c" "'``fF/0,g_V/Y)>^.(a0(,%<A.`8N:q*Rd|lCy0t9N'FDPs|S,$2(^$/*>5Ush*w87L#m@t~:[Ple+=Od633Z3m3xGV.zX+a-N%x1K=J7gOO=?1c$HZU78iVtJG1N[s@-eH#DwH]V5l}??XWI.YJ;4%:LmAEML9%4jm'Y6GXTc{DT7Iia$!+/[x.),b]5`iO3E,-+,44+9Fke45Z=m^ba.EP^)+GqZ.uQNF*sU9'Kxq6i19+ie*6rZjjCC.2`rSYVqlmHlHqeFBCapXXSxXROXUrljMWGsicEdCdPJuvbXnPXlENaBzpMBnRgtGsFtTYbHsyilugLrTSTMvGDGqSIhXhJISqnIuBwxfqr`'" ; echo $tevar
-bash: błąd składni przy nieoczekiwanym znaczniku `)'

I am getting error
Code:
-bash: błąd składni przy nieoczekiwanym znaczniku `)'

What is important - I need to pass different length strings, I don't know the length, and the positions of special characters.
This is a password from my password list and I need find working pass to archive.

What can I do to pass very long stream with any special character as a string and put it as variable in bash script?

Or - maybe I can make it outside the bash ? I am using 7 zip command line tool where I need to put the password as parameter like

7z t -pP@55w0rd!

where P@55w0rd! is my password.

What was my fault before (long time ago)- I have had used almost 5000 characters in passwords. I have lot of possible passes in my dictionary, and I am sure, that one of them will be correct.

Last edited by rbatte1; 11-15-2017 at 07:10 AM.. Reason: CODE tags and spelling corrections
 

8 More Discussions You Might Find Interesting

1. Programming

How i can read a long integer from standar input and a string with as many characters as specified..

how i can read a long integer from standar input and a string with as many characters as specified in the number? i thing that i must use the read command ofcourse.... (6 Replies)
Discussion started by: aintour
6 Replies

2. Shell Programming and Scripting

SSH - Passing Unix login passwords through shell scripts

Hi All , I need to call a script runscript_B.sh on server A, the runscript_B.sh script locating in server B. The runscript_B.sh in calls another script runscript_A on server A itself. it seend, i need to be connect from Server A to Server B using ssh. I have tryed like this in... (3 Replies)
Discussion started by: koti_rama
3 Replies

3. Shell Programming and Scripting

Need help with spec. characters.

Hi., I need transfer as parameter into shell script some spec. characters, for example " or ' or & or \ at the end of second parameter. (this parameter used as changed password). How I can transfer it into shell script. Thanks Staas,. (5 Replies)
Discussion started by: beckss
5 Replies

4. Shell Programming and Scripting

Reading a string and passing passing arguments to a while loop

I have an for loop that reads the following file cat param.cfg val1:env1:opt1 val2:env2:opt2 val3:env3:opt3 val4:env4:opt4 . . The for loop extracts the each line of the file so that at any one point, the value of i is val1:env1:opt1 etc... I would like to extract each... (19 Replies)
Discussion started by: goddevil
19 Replies

5. Programming

Passing printf formatting parameters as variables

Hi, I haven't programed in C in a few years. I have been doing a lot of shell scripting, I.E. not really programming anything heavy. :o That said, I have a script that gives hourly usage statistics for our email server. It runs w-a-y to slow as a script for my impatience, and needs to... (7 Replies)
Discussion started by: mph
7 Replies

6. Shell Programming and Scripting

Align with printf or other method

below line is one by one print audio_play PASS boot_check FAIL ethernet_change_mac NIC_82574L PASS gps_ublox_neo FAIL storage_bonnie USB2 PASS storage_copy_big_file USB2 PASS I would like below format ... (7 Replies)
Discussion started by: yanglei_fage
7 Replies

7. Shell Programming and Scripting

How to avoid "Too many arguments" error, when passing a long String literal as input to a command?

Hi, I am using awk here. Inside an awk script, I have a variable which contains a very long XML data in string format (500kb). I want to pass this data (as argument) to curl command using system function. But getting Too many arguments error due to length of string data(payloadBlock). I... (4 Replies)
Discussion started by: cool.aquarian
4 Replies

8. UNIX for Beginners Questions & Answers

How to put a 80 character limit on a long topic line in markdown?

I have a topic line in markdown that spans more than 80 characters that i need to add a line break. Markdown is simply treating the line break as a brand new line instead of continuing as a topic line. Eg: # This is a very long line Markdown interprets it as This is a very long line (4 Replies)
Discussion started by: dragonpoint
4 Replies
ltostr(3C)																ltostr(3C)

NAME
ltostr(), ultostr(), ltoa(), ultoa() - convert long integers to strings SYNOPSIS
Obsolescent Interfaces DESCRIPTION
Convert a signed long integer to the corresponding string representation in the specified base. The argument base must be between 2 and 36, inclusive. Convert an unsigned long integer to the corresponding string representation in the specified base. The argument base must be between 2 and 36, inclusive. Convert a signed long integer to the corresponding base 10 string representation, returning a pointer to the result. Convert an unsigned long integer to the corresponding base 10 string representation, returning a pointer to the result. These functions are smaller and faster than using for simple conversions (see printf(3S)). Obsolescent Interfaces convert long integers to strings. ERRORS
If the value of base is not between 2 and 36, and return NULL and set the external variable to ERANGE. WARNINGS
The return values for and point to data whose content is overwritten by subsequent calls to these functions by the same thread. and are obsolescent interface supported only for compatibility with existing DCE applications. New multi-threaded applications should use and AUTHOR
and were developed by HP. SEE ALSO
strtol(3C), printf(3S), thread_safety(5). ltostr(3C)
All times are GMT -4. The time now is 04:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy