Sponsored Content
Full Discussion: Unknown problem-beginner
Top Forums Shell Programming and Scripting Unknown problem-beginner Post 302397005 by danmero on Saturday 20th of February 2010 11:06:54 AM
Old 02-20-2010
Quote:
Originally Posted by hakermania
Code:
read number
if [ "$number" == "$num1" ]; then

Missing semi-colon.

Quote:
Originally Posted by hakermania
When it was first time run, the user would push 7 in order to give his interface (in the program $int).
And where you declare $int variable ?

On my opinion you should opt for a case/esac statement like:

Code:
#!/bin/sh
while :;do echo "
Type what you wanna do...
1= Start interface   2= Stop interface   3= See your mac
4= Change your mac   5= Hack WEP......   6= Hack WPA....
IF YOU RUN FIRST TIME --> 7= Say which is your interface"
read number
        case $number in
                1)
                        int=`cat /home/alex/Documents/hakforothers/${int}`
                        airmon-ng start $int;;
                2)
                        int=`cat /home/alex/Documents/hakforothers/${int}`
                        airmon-ng stop $int;;
                3)
                        int=`cat /home/alex/Documents/hakforothers/${int}`
                        macchanger -s $int;;
                4)
                        int=`cat /home/alex/Documents/hakforothers/${int}`
                        macchanger -m 00:11:22:33:44:55 $int;;
                5|6)
                        exit;;
                7)
                        echo $int > /home/alex/Documents/hakforothers/${int};;

                *)
                        echo "[$number] wrong option, try again !";;
        esac
done

 

10 More Discussions You Might Find Interesting

1. Programming

A beginner's problem

Hi, I'm a beginner to study linux program, I know use gcc can link one *.c file to a exe file, but how to link different source files(*.c) to a exe at once. AnyBody know and tell me, thanks. (2 Replies)
Discussion started by: kira_freedom
2 Replies

2. Shell Programming and Scripting

Please help. I am a beginner.

Alrigt, I need to write a shell script where it counts the number of folders and files and dispays "My home directory has 'x' files and 'y' directories." So, I was thinking of doing this. set x = `ls | wc` so, if I have 8 files and folders in my home directory, x is not 8. now, I was... (1 Reply)
Discussion started by: Lykathea Aflame
1 Replies

3. Shell Programming and Scripting

Beginner export problem

Me dumb. Can't get this to work... #!/bin/sh export JAVA_HOME_BAK=${JAVA_HOME} or #!/bin/sh export JAVA_HOME_BAK=/usr/java or #!/bin/sh export JAVA_HOME_BAK=$JAVA_HOME or #!/bin/sh export JAVA_HOME_BAK $JAVA_HOME etc.... none work. Either i get: "JAVA_HOME_BAK=/usr/java: is not... (1 Reply)
Discussion started by: xplodersuv
1 Replies

4. Solaris

PING - Unknown host 127.0.0.1, Unknown host localhost - Solaris 10

Hello, I have a problem - I created a chrooted jail for one user. When I'm logged in as root, everything work fine, but when I'm logged in as a chrooted user - I have many problems: 1. When I execute the command ping, I get weird results: bash-3.00$ usr/sbin/ping localhost ... (4 Replies)
Discussion started by: Przemek
4 Replies

5. UNIX for Dummies Questions & Answers

Beginner Help

hi guys, i have a DEl xps laptop cor 2 duo 2.2 i have vista installed on it i want to install a dual Boot UNIX on it.. can some one guide me ...cause i m tottaly new to UNIX i want to install unix on that laptop along with Vista.... thx any help would be deeply appreciated (sorry if i... (5 Replies)
Discussion started by: Farhan082
5 Replies

6. Shell Programming and Scripting

Unknown Problem. I really want your help to solve this!

Take a look on this code: #!/bin/sh currentpath=`pwd` if ; then #Normal user if ; then "$currentpath"/.cleaner else ./runit fi else #Root user if ; then rm -r /some fi mkdir /some cd /home/ echo "`ls --group-directories-first -1`" > /some/allusers cat /some/allusers | sed 's/... (17 Replies)
Discussion started by: hakermania
17 Replies

7. UNIX for Dummies Questions & Answers

Beginner - What Should I Do First?

Hi people.... I have just started to learn unix.I want to know which version of Unix to install plus how to install it.I need to practise and make myself aware of how unix works.My thread is from an educational point of view.Also please feel free to give your suggestions as I am... (3 Replies)
Discussion started by: amit.kanade1983
3 Replies

8. Programming

C++ Beginner Problem With Optget

Hi. I am new to C++. But I am trying to write a basic program that uses the command line. But... $ ./myscript -s 1 -e 8 -c billy -v 1 -o test I get output like this... Starting Length = 1 Ending Length = 8 Name = (null) Output File = (null) Verbose = 1 How come 'Name' and 'Output... (2 Replies)
Discussion started by: cbreiny
2 Replies

9. Shell Programming and Scripting

Unknown (probably) simple problem with my code

I'm relatively new to both UNIX and Linux and slightly less new at programming. But I can't figure out why this won't run properly. It's meant to calculate the GCD of two numbers (simple enough, you'd think). And I designed it myself and it looks good to me and my instructor won't respond. If... (1 Reply)
Discussion started by: Sevchenko
1 Replies

10. Red Hat

Help me please i am beginner

i have windows 8 host on Dell Laptop vmware 9 redhat 7.2 iso downloaded through redhat official site after installation on vm it only boots into text dont show graphics Please guide:( (1 Reply)
Discussion started by: hananabbas
1 Replies
alex(1mh)																 alex(1mh)

Name
       alex - extract addresses from message headers

Syntax
       alex [ +folder ] [ msgs ] [ options ]

Description
       The  address  line  extraction  utility	extracts electronic mail addresses from message headers and prints the addresses on your screen or
       places them, with a specified alias name, in an alias file.

       By default, searches for addresses in the current message in the current folder.  You can list the messages you wish  to  search  giving  a
       msgs argument.  You can also search messages in a different folder by giving a +folder argument.

       You  define  the  fields from which you want addresses by using combinations of field names with the -field option.  You can also supply an
       address yourself as a value to the -address option.  Results are printed either to your screen or to a file in format.  Where there  is	an
       address	group  in  the	alias  file  with  an alias name identical to one you have specified in an command, it may be replaced	or the new
       addresses appended.  A copy of the original alias file is kept.

       By default, searches the Reply-to:, Sender:, From: and To: header fields in that order until an address is found. You can set up  your  own
       default values for in your file; see

       When giving options to the command, generally the shortest unique abbreviation suffices.

Options
       -address string
		 Accepts  an  address  that  you  type in, rather than taking an address from a message.  If any -field option is specified, it is
		 ignored.

       -alias filename
		 Specifies the name of the alias file, in which aliases are placed.  You must provide a file name or a dash  (-)  as  an  argument
		 with  this  option.   There  is  no default value.  If the value given for this option is -, or the option is not specified, will
		 print the output to your screen.  If you do not give the full pathname of your alias file, will look for the alias file  in  your
		 Mail  directory, as specified in the Path field of your file.	If cannot locate the alias file in the directory that you specify,
		 it will ask you whether or not you wish to create one.

		 You can set up an alias file to be used by in your see for more information.  Like other mail commands, uses the Aliasfile  entry
		 to find the alias file.

       -compress
       -nocompress
		 Prevents  any repetition of the same address in the output of an command.  You can use this option when there are multiple occur-
		 rences of an address in an address group and you want just one occurrence of it in your alias.  The default is -nocompress.

       -field name[ /name ... ]
       -nofield  Specifies the name of a header field.	The name of the field is not case-sensitive.  If you specify this option without providing
		 an  argument,	the  default  values  are:  -field reply-to/sender/from/to.  You can set up your own default values for the -field
		 option in your See

		 Examples of field names are From, cc and To.  You must not type a colon after the name of a field.  When more field names follow,
		 in the form /name, the message header is searched for each of the fields in turn until one is found.  Only the first header field
		 found to contain an address is used; the rest are ignored.

		 The option -nofield excludes the named field.

		 The special name, all, means all fields, and can be used as a value for the -nofield option to  override  any	default  order	of
		 header fields, otherwise -field values are appended to any default values.

       -global	 Specifies  that  any  address replacements or appendings will apply to all occurrences of that alias name.  Normally, if an alias
		 name is entered in the alias file more than once, any actions performed by are performed only on the  first  occurrence  of  that
		 alias name.  The -global option ensures that any changes are made to all occurrences of the alias.  Whenever this option is spec-
		 ified, a message is broadcast to your screen telling you how many entries in the alias file have been changed.

       -help	 Prints a list of the valid options for this command.

       -name name
		 Specifies the alias name for address information extracted.  The command appends a colon (:) to the name as required by If you do
		 not  specify  this  option, will print extracted addresses to your screen.  If you specify this option, you must provide an argu-
		 ment; there is no default value.

       -query
       -noquery  Extracts addresses interactively.  Before adding each address of a list of extracted addresses to an alias group, the mail system
		 will ask you whether you wish the address to be added.  The query prompt is written on the standard error output.  The default is
		 -noquery.

       -replace
       -noreplace
		 Replaces existing alias with the new list of addresses.  By default, if there is an existing alias with the same name as the  one
		 you  are  trying  to  create, appends the new address list to the old alias.  If an address appears in both address groups, it is
		 still appended, so that it appears twice in the new alias.  You can specify this explicitly by using the -noreplace  option.	If
		 you specify the -replace option, the new list of addresses replaces the existing group.  The default is -noreplace.

       -width n  Specifies  the  maximum width of your alias file line.  If an alias group extends beyond this length, it is continued on the next
		 line, with a backslash () at end of the first line.  This option affects the format of each individual entry when it	is  imple-
		 mented; any subsequent or previous entries in the alias file remain the same.	The default is 72 characters.

Restrictions
       Because the -nofield option can take the value all as an argument, will not recognize a header field called All.  If you wish to use such a
       header field, you should call it X-all.

       If a command line contains contradictory arguments then the last value specified is used.  For example, in the following command, only uses
       the options -name fred and -noreplace:
       % alex -name sam -name fred -replace -noreplace

Examples
       This example takes the address from the From field of the current message, and places it in your alias file with the alias name bob:
       % alex -field from -alias aliases -name bob

       The  following  example	shows what happens if you specify an alias file that does not exist.  You are asked whether you want to create the
       file; enter y to create it:
       % alex -field from -name bob -alias aliases
       Create alias file "HOME/Mail/aliases"? y

       The next example takes addresses from two fields, From and cc, and saves them as the alias sales_team:
       % alex -field from -field cc -alias aliases -name sales_team

Files
       Your user profile.

See Also
       ali(1mh), mh(1mh), pick(1mh), mh-alias(5mh), mh_profile(5mh)

																	 alex(1mh)
All times are GMT -4. The time now is 07:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy