How to iterate a function untill last argument with any order of input?
HI
I need to get the function "kick" to get executed in any way the parameters are passed in to the function. The parameters are first stored in a dictionary
1) I am passing arguments i) vegetables ii) fruits to the function kick
The output expected is as follows:
When I pass first argument "vegetable" second argument "fruit" the loop flows to "else" condition and gets executed only for second argument "fruit" then it should pass to first argument and get "vegetable" parameter also executed.
But here with this code when I pass first argument "vegetable" second argument "fruit" the loop flows to "else" condition and gets executed only for second argument "fruit" and the flow ends.
Please help to get all arguments getting executed with any order (vegetable, fruit) or (fruit, vegetable) provided as input.
May i know how to pass an argument to a function in a shell script?
Sorry, i din stated that it is in a shell script in my previous post.
Means: checkStatus() {
...........
}
read status;
I wanna use the status in the function checkstatus, how... (2 Replies)
----------C program-----------------------------
include <stdio.h>
int main( int argc, char *argv )
{
int i;
for( i=0; i<argc; i++ )
printf("%\n", argv);
return 0;
}
I wrote the C program above 'print.c'.
Then, I compiled. (gcc -o print.o print.c)... (2 Replies)
Hi,
Can someone please explain to me how I can get a function to recognize a file given as an argument to a script.
Suppose the script has the argument as follows:
sh script file
and the function is as follows:
function display_file () {
cat $1
}
and it s then called
#main program... (1 Reply)
Hi All,
Calling a function with one argument and storing the return value in a shell script is as below:( so far I know)
value="`fun_1 "argument1"`"
Its working perfectly for me.
Can u help me with passing more than one argument and storing the return value
Thnaks in advance
JS (1 Reply)
I have the following code :
function1 ()
{
print "January"
}
function2()
{
case $1 in
January)
print "Dzisiaj mamy styczen"
;;
*)
;;
}
main()
{ (1 Reply)
Dear Forum
I'm Trying to use split function to split a string, but the output is not as the same order as of the string, please see simple example
echo " " | nawk -v var="First;Second;Third;Fourth" '
BEGIN {split(var, arr,";") for(i in arr){print arr }}'
The output is
Second
Third... (6 Replies)
HI
i have written a script to ask input from the user.
this script should promote the user for y/n input. if user enters anyother input then y/n
the script promotes him again. this below code is working fine for all the cases.
except for space and enter " if i give space and enter it is... (2 Replies)
Hi all,
In the given script code .
I want to pass the maximum value that variable "i" will have in function DivideJobs () to variable $max of function SubmitCondorJob().
Any help?
Thanks
#!/bin/bash ... (55 Replies)
Dear Friends,
I am looking for a shell script to merge input files into one file .. here is my idea:
1st paramter would be outfile file (all input files content)
read all input files and merge them to input param 1
ex: if I pass 6 file names to the script then 1st file name as output file... (4 Replies)
When I use the following grep command with options -F and -f, its just displaying the text related to only the last pattern.
Command: $ grep -f pattern_file.txt input_file.txt
Output: doc-C2-16354
Even the following command yields the same output:
Command: $ grep -Ff pattern_file.txt... (6 Replies)
Discussion started by: nsai
6 Replies
LEARN ABOUT DEBIAN
psk-crack
PSK-CRACK(1) General Commands Manual PSK-CRACK(1)NAME
psk-crack - Crack IKE Aggressive Mode Pre-Shared Keys
SYNOPSIS
psk-crack [options] <psk-parameters-file>
<psk-parameters-file> is a file containing the parameters for the pre-shared key cracking process in the format generated by ike-scan with
the --pskcrack (-P) option. This file can contain one or more entries. For multiple entries, each one must be on a separate line.
The program can crack either MD5 or SHA1-based hashes. The type of hash is automatically determined from the length of the hash (16 bytes
for MD5 or 20 bytes for SHA1). Each entry in the <psk-parameters-file> is handled separately, so it is possible to crack a mixture of MD5
and SHA1 hashes.
psk-crack can also crack the proprietary hash format used by Nortel Contivity / VPN Router systems. When cracking Nortel format hashes,
you need to specify the username of the hash that you are cracking with the --norteluser (-u) option. When cracking Nortel format hashes,
you can only crack one hash at a time.
By default, psk-crack will perform dictionary cracking using the default dictionary. The dictionary can be changed with the --dictionary
(-d) option, or brute-force cracking can be selected with the --bruteforce (-B) option.
DESCRIPTION
psk-crack attempts to crack IKE Aggressive Mode pre-shared keys that have previously been gathered using ike-scan with the --pskcrack
option.
psk-crack can operate in two different modes:
1) Dictionary cracking mode: this is the default mode in which psk-crack tries each candidate word from the dictionary file in turn
until it finds a match, or all the words in the dictionary have been tried.
2) Brute-force cracking mode: in this mode, psk-crack tries all possible combinations of a specified character set up to a given
length.
OPTIONS --help or -h
Display this usage message and exit.
--version or -V
Display program version and exit.
--verbose or -v
Display verbose progress messages.
--dictionary=<f> or -d <f>
Set dictionary file to <f>. The default is /usr/local/share/ike-scan/psk-crack-dictionary.
--norteluser=<u> or -u <u>
Specify the username for Nortel Contivity cracking. This option is required when cracking pre-shared keys on Nortel Contivity / VPN
Router systems. These systems use a proprietary method to calculate the hash that includes the username. This option is only
needed when cracking Nortel format hashes, and should not be used for standard format hashes.
--bruteforce=<n> or -B <n>
Select bruteforce cracking up to <n> characters.
--charset=<s> or -c <s>
Set bruteforce character set to <s> Default is "0123456789abcdefghijklmnopqrstuvwxyz"
AUTHOR
Roy Hills <Roy.Hills@nta-monitor.com>
February 14, 2005 PSK-CRACK(1)