Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to make a program that inputs commands automatically?

Status
Not open for further replies.

safwatonline

Advanced Member level 4
Joined
Nov 19, 2005
Messages
1,341
Helped
219
Reputation
438
Reaction score
48
Trophy points
1,328
Location
EGYPT
Activity points
9,038
csh & cshrc in cadence stands for

hello,
i am using fedora core 3 , i have some routine commands that i do "in terminal" each time i start the linux ,i want to automize this process,
how can i make a small program "executable- stand alone", that opens the terminal and excute these commands in sequence , i really dont have programming experience so i need steps in DETAILS,

note , i tried doing a shell scripts, but it didnt work with me ,
what i want to do is :

csh ---change root's shell to c shell
source ./.cshrc ----- open .cshrc
icms ----- open cadence tools

thats it
thnx.
 

Re: Commands

I would think a shell script would be easiest.

Code:
!#/bin/sh

csh 
source ./.cshrc 
icms

Don't know if you need root permissions for some of your progs and then just set you script file to executable and run with something like

Code:
./Script_File

This should work I think
 

Commands

hello,
thnx for the help, i am doing this for the root account , the idea is that i want when the program excute , open terminal originally bash and then change shell(csh), after this excute some commands like opening the file .cshrc "source ./.cshrc" and finally running the tools by command "icms", the problem in shell scripts occur "i guess" in changing the shell as when i do a shell script
it only changes the shell and dont continue the following commands , do i need to set a path for the .cshrc ,
i was wondering if this is doable by C program, if so how?
thnx v.much 4 the help
a.safwat
 

Commands

hello,
thnx for reply,but it didnt work, it changed the shell to C shell and stop.
 

Commands

For a quick reply on the program in C.
This wil be quite tedious. since you will prob have to allocate memory for the processes and the fork childs or just run the execX commands...I don't have a lot of experience in tunning external apps in a C program. But I think that a shell script would be a lot easier.
 

    safwatonline

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top