Sponsored Content
Full Discussion: Multiplication Table in UNIX
Homework and Emergencies Homework & Coursework Questions Multiplication Table in UNIX Post 302977146 by larkha on Wednesday 13th of July 2016 08:58:18 AM
Old 07-13-2016
Multiplication Table in UNIX

How can I produce this kind of output?

Enter a number: 3
MULTIPLICATION TABLE:

0 1 2 3
1 1 2 3
2 2 4 6
3 3 6 9

When you enter a number, it should show you the corresponding multiplication table. Plus we need to use for loops that I do not actually know. Thanks in advance! Here is my code

#!/bin/bash
echo Enter a number:
read num
iter=1
while [ $num –le 5 ]
do
res=`expr $num \* $iter`
echo $num “*” $iter “=” $res
iter=`expr $iter + 1`
done
 

10 More Discussions You Might Find Interesting

1. Programming

how to view symbol table in unix

hi , How to view the contents of a "c" program symbol table information in unix. (1 Reply)
Discussion started by: saravanan_nitt
1 Replies

2. Shell Programming and Scripting

unix file to oracle table

Hi , Can anyone help me regarding loading a unix file data to oracle database table using shell scripts? I wanted to grep only this data from a spool file sql_test.txt 99 00:00:00:01 but if I use grep I am getting format sql_test.txt 99 rows selected. Elapsed:... (2 Replies)
Discussion started by: ran16
2 Replies

3. Shell Programming and Scripting

Creating table in Unix

Hi All, In a given directory, I need to list the files present in it in the below given format as a table. File name Permission Number of Bytes File Type Telecom1 --w-r-x 1230 Directory Telecom2 ---x---x---x 450 Device file Telecom3 ... (7 Replies)
Discussion started by: mr_manii
7 Replies

4. UNIX for Dummies Questions & Answers

nested loop:multiplication table

I need help to produce output as below 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 5 10 15 20 25 my script #!/bin/bash for (( i = 1; i <= 5; ++i )); do echo -n $i for (( j = 1; j <=5; ++j )); do multiply=$(( $i * $j )) done echo $multiply (1 Reply)
Discussion started by: killboy
1 Replies

5. Shell Programming and Scripting

Insert into Oracle table thru UNIX - linux 2.6.9-89

Hi, I am trying to insert a record into a table (say dips_tbl) which resides in Oracle DB through a ksh script. I want to insert records into few of the table columns-not all. I'll give an e.g. for the date column "CREATE_DATE". For that I first execute SQL1="SELECT SYSDATE FROM DUAL" ... (1 Reply)
Discussion started by: dips_ag
1 Replies

6. Shell Programming and Scripting

Error with "multiplication table" in shell script

#!/bin/sh echo Enter the multiplication number required: read number for i in 1 2 3 4 5 6 7 8 9 10 do echo "$number * $i = expr $number \* $i" done I am not getting the output for this multiplication table. (4 Replies)
Discussion started by: vinodpaw
4 Replies

7. UNIX for Dummies Questions & Answers

Create a table - very new to unix

I need to create a simple table of information by grepping several columns from various files and display them all at once with simple headers on top. Can anyone help get me started? I am very new to unix so I really have no idea how to work with this and I appreciate any help I can get! Let me... (11 Replies)
Discussion started by: aj250
11 Replies

8. UNIX for Dummies Questions & Answers

Hash Table like implementation in unix

Hi all, I just downloaded this example from the net. I was looking around for a hash table like implementation in unix when I came across this. ARRAY=( "cow:moo" "dinosaur:roar" "bird:chirp" "bash:rock" ) for animal in ${ARRAY} ; do KEY=${animal%%:*} ... (8 Replies)
Discussion started by: anindyabecs
8 Replies

9. Shell Programming and Scripting

How to sort matrix table in UNIX?

Hello All, i have a file sort.txt with below entries. 1 12 10 16 6 4 20 8 15 i need to sort these entries and the out put should come in a single line. 1 4 6 8 10 12 15 16 20 Can you please help me sort this out? (2 Replies)
Discussion started by: sureshk_85
2 Replies

10. Shell Programming and Scripting

How to lock Oracle table through UNIX?

Hi frndz, Can anyone provide me some input or pseudo code for my req as mentioned below... I am loading 2 files through unix script into oracle table...as i am doing some updates also i am getting an error where both files try to update the table simultaneously and my script fails.. so i... (3 Replies)
Discussion started by: gnnsprapa
3 Replies
Gtk2::TextIter(3pm)					User Contributed Perl Documentation				       Gtk2::TextIter(3pm)

NAME
Gtk2::TextIter - wrapper for GtkTextIter HIERARCHY
Glib::Boxed +----Gtk2::TextIter METHODS
textattributes = $iter->get_attributes boolean = $iter->backward_char boolean = $iter->backward_chars ($count) o $count (integer) boolean = $iter->backward_cursor_position boolean = $iter->backward_cursor_positions ($count) o $count (integer) boolean = $iter->backward_find_char ($pred, $user_data=undef, $limit=undef) o $pred (scalar) o $user_data (scalar) o $limit (Gtk2::TextIter or undef) boolean = $iter->backward_line boolean = $iter->backward_lines ($count) o $count (integer) (match_start, match_end) = $iter->backward_search ($str, $flags, $limit=NULL) o $str (string) o $flags (Gtk2::TextSearchFlags) o $limit (Gtk2::TextIter or undef) boolean = $iter->backward_sentence_start boolean = $iter->backward_sentence_starts ($count) o $count (integer) boolean = $iter->backward_to_tag_toggle ($tag) o $tag (Gtk2::TextTag or undef) boolean = $iter->backward_visible_cursor_position Since: gtk+ 2.4 boolean = $iter->backward_visible_cursor_positions ($count) o $count (integer) Since: gtk+ 2.4 boolean = $iter->backward_visible_line Since: gtk+ 2.8 boolean = $iter->backward_visible_lines ($count) o $count (integer) Since: gtk+ 2.8 boolean = $iter->backward_visible_word_start Since: gtk+ 2.4 boolean = $iter->backward_visible_word_starts ($count) o $count (integer) Since: gtk+ 2.4 boolean = $iter->backward_word_start boolean = $iter->backward_word_starts ($count) o $count (integer) boolean = $iter->begins_tag ($tag) o $tag (Gtk2::TextTag or undef) textbuffer = $iter->get_buffer integer = $iter->get_bytes_in_line boolean = $iter->can_insert ($default_editability) o $default_editability (boolean) character = $iter->get_char integer = $iter->get_chars_in_line textchildanchor or undef = $iter->get_child_anchor integer = $lhs->compare ($rhs) o $rhs (Gtk2::TextIter) boolean = $iter->editable ($default_setting) o $default_setting (boolean) boolean = $iter->ends_line boolean = $iter->ends_sentence boolean = $iter->ends_tag ($tag) o $tag (Gtk2::TextTag or undef) boolean = $iter->ends_word boolean = $lhs->equal ($rhs) o $rhs (Gtk2::TextIter) boolean = $iter->forward_char boolean = $iter->forward_chars ($count) o $count (integer) boolean = $iter->forward_cursor_position boolean = $iter->forward_cursor_positions ($count) o $count (integer) boolean = $iter->forward_find_char ($pred, $user_data=undef, $limit=undef) o $pred (scalar) o $user_data (scalar) o $limit (Gtk2::TextIter or undef) boolean = $iter->forward_line boolean = $iter->forward_lines ($count) o $count (integer) (match_start, match_end) = $iter->forward_search ($str, $flags, $limit=NULL) o $str (string) o $flags (Gtk2::TextSearchFlags) o $limit (Gtk2::TextIter or undef) boolean = $iter->forward_sentence_end boolean = $iter->forward_sentence_ends ($count) o $count (integer) $iter->forward_to_end boolean = $iter->forward_to_line_end boolean = $iter->forward_to_tag_toggle ($tag) o $tag (Gtk2::TextTag or undef) boolean = $iter->forward_visible_cursor_position Since: gtk+ 2.4 boolean = $iter->forward_visible_cursor_positions ($count) o $count (integer) Since: gtk+ 2.4 boolean = $iter->forward_visible_line Since: gtk+ 2.8 boolean = $iter->forward_visible_lines ($count) o $count (integer) Since: gtk+ 2.8 boolean = $iter->forward_visible_word_end Since: gtk+ 2.4 boolean = $iter->forward_visible_word_ends ($count) o $count (integer) Since: gtk+ 2.4 boolean = $iter->forward_word_end boolean = $iter->forward_word_ends ($count) o $count (integer) boolean = $iter->has_tag ($tag) o $tag (Gtk2::TextTag) boolean = $iter->in_range ($start, $end) o $start (Gtk2::TextIter) o $end (Gtk2::TextIter) boolean = $iter->inside_sentence boolean = $iter->inside_word boolean = $iter->is_cursor_position boolean = $iter->is_end boolean = $iter->is_start language = $iter->get_language integer = $iter->get_line integer = $iter->get_line_index $iter->set_line_index ($byte_on_line) o $byte_on_line (integer) integer = $iter->get_line_offset $iter->set_line_offset ($char_on_line) o $char_on_line (integer) $iter->set_line ($line_number) o $line_number (integer) list = $iter->get_marks Returns a list of all Gtk2::TextMark at this location. Because marks are not iterable (they don't take up any "space" in the buffer, they are just marks in between iterable locations), multiple marks can exist in the same place. The returned list is not in any meaningful order. integer = $iter->get_offset $iter->set_offset ($char_offset) o $char_offset (integer) $first->order ($second) o $second (Gtk2::TextIter) pixbuf or undef = $iter->get_pixbuf string = $start->get_slice ($end) o $end (Gtk2::TextIter) boolean = $iter->starts_line boolean = $iter->starts_sentence boolean = $iter->starts_word list = $iter->get_tags Returns a list of tags that apply to iter, in ascending order of priority (highest-priority tags are last). string = $start->get_text ($end) o $end (Gtk2::TextIter) list = $iter->get_toggled_tags ($toggled_on) o $toggled_on (boolean) Returns a list of Gtk2::TextTag that are toggled on or off at this point. (If toggled_on is TRUE, the list contains tags that are toggled on.) If a tag is toggled on at iter, then some non-empty range of characters following iter has that tag applied to it. If a tag is toggled off, then some non-empty range following iter does not have the tag applied to it. boolean = $iter->toggles_tag ($tag) o $tag (Gtk2::TextTag or undef) integer = $iter->get_visible_line_index $iter->set_visible_line_index ($byte_on_line) o $byte_on_line (integer) integer = $iter->get_visible_line_offset $iter->set_visible_line_offset ($char_on_line) o $char_on_line (integer) string = $start->get_visible_slice ($end) o $end (Gtk2::TextIter) string = $start->get_visible_text ($end) o $end (Gtk2::TextIter) ENUMS AND FLAGS
flags Gtk2::TextSearchFlags o 'visible-only' / 'GTK_TEXT_SEARCH_VISIBLE_ONLY' o 'text-only' / 'GTK_TEXT_SEARCH_TEXT_ONLY' SEE ALSO
Gtk2, Glib::Boxed COPYRIGHT
Copyright (C) 2003-2011 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.14.2 2012-05-27 Gtk2::TextIter(3pm)
All times are GMT -4. The time now is 04:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy