You are not logged in.

#1 2011-07-06 20:02:05

kac0802
Member
Registered: 2011-07-06
Posts: 9

[SOLVED] How do I make a script?

I am relatively new to linux and very new to arch and I feel like this question definitely belongs in the "Newbie Corner". I am running Arch off a flashdrive, so I have been trying to avoid installing any unnecessary packages. I have therefore been manually typing in the commands to connect my computer to wireless network. I would like to be able to put these commands in a script and just run the script to connect, but I realized that I have no clue how to make a script. Any help would be greatly appreciated.

Thanks,
Kaleb C.

Last edited by kac0802 (2011-07-06 20:45:02)

Offline

#2 2011-07-06 20:08:04

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED] How do I make a script?

Create a file with

#!/bin/sh
firstcommand
secondcommand
thirdcommand

Then run chmod +x filename and move it to /usr/bin if you want to be able to execute it as any other command.

Last edited by lucke (2011-07-06 20:09:27)

Offline

#3 2011-07-06 20:09:19

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] How do I make a script?

Maybe you can use an alias?

I googled http://floppix.ccai.com/scripts1.html
If you use another shell (not bash) adjust accordingly.

Offline

#4 2011-07-06 20:42:28

kac0802
Member
Registered: 2011-07-06
Posts: 9

Re: [SOLVED] How do I make a script?

lucke wrote:

Create a file with

#!/bin/sh
firstcommand
secondcommand
thirdcommand

Then run chmod +x filename and move it to /usr/bin if you want to be able to execute it as any other command.

Thanks, this worked perfectly.

Thanks, this also provided much needed information about scripts.

Offline

Board footer

Powered by FluxBB