how can I create a macro file ?

Asked by one

I wanna create a macro file in terminal , How can i do that ?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Solved by:
codemaniac
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the macro to do?

Revision history for this message
one (boboahmed25) said :
#2

I need it to help me to write some commands in it fora simulation program on my unbuntu

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

ubuntu, not unbuntu.

What will the commands do exactly?

Revision history for this message
one (boboahmed25) said :
#4

I just want to create a file type of a macro

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

That doesn't make any sense. You can make bash scripts to do macro-like things. Is that what you mean?

Revision history for this message
one (boboahmed25) said :
#6

what i meant that i have a simulation program and I found that this program needs to build up macros files containing an ordered collection of commands. I know how to write commands in it ,but i wanna know exactly wt is command which makes me enable to create a macro file in the terminal to open it and then write in it my commands

Revision history for this message
Wyatt Smith (wyatt-smith) said :
#7

How about a simple bash shell script. It is just a basic text file that will execute in a terminal shell.

The initial line of the script is the sha-bang! which specifies what command shell to use. I suggest using bash, the default command shell in ubuntu. A simple bash script would look like this

#!/bin/bash
command1
command2
command3
....
exit 0

Typically the script should be named with the .sh extension (for example myscript.sh). After you save the file, you will need to make executable or it will not run.

Hope this helps

Revision history for this message
Best codemaniac (arijit.dutta) said :
#8

Macro is used in windows applications in order to automate repetitive tasks .
In linux there is shell script for you to do the jib .
Place all your commands and instructions in the shell script and execute .
Have some goggling on the topic .

Revision history for this message
one (boboahmed25) said :
#9

Thanks Arijit Dutta, that solved my question.

Revision history for this message
one (boboahmed25) said :
#10

Thanks a lot Wyatt Smith for u , ur answer helped me so much .

Revision history for this message
codemaniac (arijit.dutta) said :
#11

good to hear that .

search for abs guide , that contains a wealth of information on bash scripting .