Here are a couple of examples that should illustrate enough to get you going. You should be able to figure out how to 'plug' your code into a loop like one of these:
Heres a script i wrote as a bit of practise. What it does is insert a line in the middle of a file. The line being $1 and the file being $2
#!/bin/bash
rm tempfile
touch tempfile
count=1
linenum= `wc -l < $2`
if
then
echo $1 >> $2
else
even=`expr "$linenum" % 2`
if
then... (3 Replies)
Hallo everyone
I might just be being dumb, but I am using the BASH shell and cannot get the following script to work:
x=0
while
do
echo $x
x=´echo "$x + 1" | bc´
done
Can anybody help me out. I am just get a repeating output saying:
bc: command not found
0 + 1: command not... (5 Replies)
i have the following process running in background:
when i give "ps -lef"
------------------------------------------------------------------------
user2
user1
user1
user3
user1
user4
user5
user4
user3
user4
user2
user1
user1
user3
user1
user4 (3 Replies)
Hi expert,
I'm using csh
Code:
#!/bin/csh
set x = 0
set number = `awk '{array=$0} END {print array;}'`
i want to use for loop to store data to $number repeatly
untill x = 23
How to use c shell for loop? (2 Replies)
I need to chmod a bunch of files with a specific extension in one directory.
If I understand correctly first I would run ls command like this
ls -R | grep .mp3 > /tmp/list
once I have the output file I should be able to run a loop to chmod all the files in the list created.
This is where... (5 Replies)
Hello,
I'm trying to write a while loop for a decimal value in tcsh which I know can't be done. Instead I want my increments to be one order of magnitude too large and then divide it by 10 when I use the variable. However, I don't know how to divide my variable and set it as another.
set... (1 Reply)
Does any body can help me with a loop in this example?
if
then
if
then
runner=$(grep "$1" "$2")
runne=$(grep "$1" "$3")
run=$(grep "$1" "$4")
fi
fi
#
# Message on screen... (3 Replies)
I am trying to make a calculator. The user Enters number 1, chooses and operation, enters number 2, then chooses another operation or for the answer to be displayed.
eg. 1 + 1 = or 1 + 1 + 2 + 1 =
Both of these should be possible.
#!/bin/bash
read -p "what's the first number? " n1... (3 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known/data:
Script a simple calculator. In the command line enter the script file
/home/etc/mycalc or /home/etc/mycalc 1 +... (6 Replies)
ADE is a UNIX environment for the ancient AMIGA A1200. By default this does NOT have the 'bc' command line calculator.
Although I did a DEMO code to create a C source and compile it under python 1.4.0 and ADE using ksh88 and the gcc of the day, I decided to create this baby that requires no Python... (2 Replies)
Discussion started by: wisecracker
2 Replies
LEARN ABOUT DEBIAN
net::cli::interact::manual::phrasebook
Net::CLI::Interact::Manual::Phrasebook(3pm) User Contributed Perl Documentation Net::CLI::Interact::Manual::Phrasebook(3pm)NAME
Net::CLI::Interact::Manual::Phrasebook - List of Supported CLIs
INTRODUCTION
The bundled phrasebook includes support for a variety of network device CLIs. Many were contributed by users of the module. If you set up
a new CLI dictionary, please consider contributing it back! The phrasebook specification is given in Net::CLI::Interact::Phrasebook.
For each supported CLI, there is a name which must be passed in the "personality" option to Net::CLI::Interact's "new()" method. After
that, you can call the included Macros, and the module will use the included Prompt to match the current state of the CLI. More information
is available in the Tutorial and Cookbook.
Below is a list of all current bundled CLI dictionaries. Each lists its name, the available Prompts, Macros and Continuations, and from
which other CLI dictionaries it inherits.
IOS # Cisco IOS
CatOS # for older, pre-IOS Cisco devices
PIXOS # for PIX OS-based devices
PIXOS7 # Slightly different commands from other PIXOS versions
FWSM # currently the same as 'PIXOS'
FWSM3 # for FWSM Release 3.x devices (slightly different to FWSM 2.x)
JunOS # Juniper JUNOS support
HP # HP support
Nortel # Nortel support
ExtremeOS # Extreme Networks support
Foundry # Foundry/Brocade device support
PERSONALITIES
Cisco
This personality goes by the name of "cisco" and provides a basis for many other CLI dictionaries.
Prompts are "basic", "privileged", "configure", "user", and "pass".
Macros are "begin_privileged", "end_privileged", "begin_configure", "end_configure", and "disconnect".
CatOS
This personality goes by the name of "catos" and inherits from the "cisco" dictionary.
Additionally it provides the "privileged" Prompt.
Additionally it also provides the "paging" Macro to set the terminal page size.
ExtremeOS
This personality goes by the name of "extremeos" and inherits from the "cisco" dictionary.
Additional Prompts are "basic", "privileged", "configure", "user", and "pass".
Additional Macros are "begin_privileged", "end_privileged", and "disconnect".
Foundry / Brocade
This personality goes by the name of "foundry" and inherits from the "cisco" dictionary. Before connecting to the device you probably want
to set the output separator to be:
$nci->transport->ors("
");
For users of Net::Appliance::Session this should be:
$session_obj->nci->transport->ors("
");
IOS
This personality goes by the name of "ios" and inherits from the "cisco" dictionary.
Additionally it provides the "paging" Macro to set the terminal page size.
HP
This personality goes by the name of "hp" and inherits from the "cisco" dictionary.
Additionally it provides the "basic" and "user" Prompts.
JunOS
This personality goes by the name of "junos" and inherits from the "cisco" dictionary.
Additionally it provides the "privileged", "configure", and "user" Prompts.
Additionally it also provides the "begin_configure" and "paging" Macros.
Nortel
This personality goes by the name of "nortel" and inherits from the "cisco" dictionary.
Additionally it provides the "user" Prompt.
PIXOS
This personality goes by the name of "pixos" and inherits from the "cisco" dictionary.
Additionally it provides the "paging" Macro to set the terminal page size.
It can be used in its own right for Cisco PIX firewalls, but is also used as a base for other dictionaries.
PIXOS 7
This personality goes by the name of "pixos7" and inherits from the "pixos" dictionary.
Additionally it provides the "paging" Macro to set the terminal page size.
FWSM
This personality goes by the name of "fwsm" and inherits from the "pixos" dictionary.
It provides no further functionality, as Cisco FWSM software version 1 and 2 was the same as the PIX OS.
FWSM 3
This personality goes by the name of "fwsm3" and inherits from the "pixos" dictionary.
Additionally it provides the "paging" Macro to set the terminal page size.
perl v5.14.2 2012-06-12 Net::CLI::Interact::Manual::Phrasebook(3pm)