![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MAKE and its macros and variables | JerryHone | UNIX for Dummies Questions & Answers | 1 | 04-19-2008 11:23 AM |
| One last question about capability macros | frequency8 | High Level Programming | 1 | 05-23-2007 02:10 PM |
| saving macros for VIM | yngwie | UNIX for Dummies Questions & Answers | 3 | 05-14-2007 01:26 AM |
| Expect and auto expect command | arun_v | Shell Programming and Scripting | 0 | 03-29-2006 08:31 AM |
| troff macros | tonyt | UNIX for Dummies Questions & Answers | 2 | 01-03-2002 08:13 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Expect Terminal Macros
Hey people!
I just started out working at an ISP as tech support and thought that I should ease the work load by scripting some small macros. I create different commands with Alias through .bashrc which are all directed to the same script file. Here I planned on using Expect to run different input macros. Problem i came across though is that I can't set a varible to the command i ran to execute the script file. So i .bashrc i have written alias command2="~/scirpt.file" and in script.file i have made the different rules for each command. An easy solution to the problem would be to create one script file for each command, but that isn't as neat, easpesially not if I want to distribute the script to my collegues. What i need in script.file is a line that sets a variable to the command that I have inputed so i can create an if-statement for which action that should be taken. so if i have the terminal like this. ghettofish@server:~$ command2 then i should go to script.file and have a statement that does the following. set input_command [code to retrive command that executed the script.file] Then later i could create an if-statement that would be something like if ($input_command == "command2") blah blah Anyone got any ideas? Hope someone could help me out with this. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|