Results 1 to 16 of 16
-
06-22-2002, 11:41 PM #1Web Hosting Master
- Join Date
- Feb 2002
- Posts
- 956
Like MS-DOS batch file but for Linux?
how
thanks
-
06-22-2002, 11:50 PM #2Web Hosting Master
- Join Date
- Jun 2001
- Location
- Earth
- Posts
- 1,259
Umm, it's just like writing a dos batch file, but you don't need the extension. Assuming you're using bash as a shell, make the first line of the scirpt:
#! /bin/bash
And then just type the commands you want to execute. Change the script to be executable and presto! shell script.
That first line tells the shell to run this script under bash.
If you can give more details, I can give a more specific example.
Frank█ Umbra Hosting
█ cPanel | Softaculous | CloudLinux | R1Soft | Ksplice
█ Web Hosting, Reseller Hosting, VPS, Dedicated Servers, Colocation
█ UmbraHosting.com
-
06-23-2002, 12:01 AM #3Web Hosting Master
- Join Date
- Feb 2002
- Posts
- 956
thanks!
-
06-23-2002, 01:30 AM #4Disabled
- Join Date
- Nov 2001
- Location
- Canada
- Posts
- 1,963
its called shell scripting! hehe
-
06-23-2002, 05:54 AM #5Web Hosting Master
- Join Date
- Feb 2002
- Posts
- 956
I have one question, if I put echo "test" in one of those files and run it, what would it output?
echo "test"
test
testThis forum officially ****ing sucks
-
06-23-2002, 06:18 AM #6Disabled
- Join Date
- Nov 2001
- Location
- Canada
- Posts
- 1,963
the second
e..g
if i type
pico file.sh
#!/bin/bash
echo yo whats your name
read name
echo hey whats up $name
then save that file
chmod +x file.sh
then type ./file.sh
you will see
-
06-23-2002, 07:42 AM #7Web Hosting Master
- Join Date
- Feb 2002
- Posts
- 956
now how do i make a command run in it, but not output anything?
This forum officially ****ing sucks
-
06-23-2002, 09:01 AM #8Disabled
- Join Date
- Nov 2001
- Location
- Canada
- Posts
- 1,963
./file.sh>/dev/null& will make it not output anything and put it in the backround
./file.sh>/dev/null will just run it and not show any output
you prolly wanna use choice #2
-
06-23-2002, 12:12 PM #9Disabled
- Join Date
- Jun 2002
- Posts
- 308
Don't tell him to make BASH shell scripts?!?!?
#!/bin/ksh
Sheesh.
-
06-23-2002, 01:35 PM #10Web Hosting Guru
- Join Date
- Apr 2002
- Location
- Troy, MI
- Posts
- 324
ksh! akk - you mean csh dont you - yes you do
Ryan MacDonald
Lead Administrator | TotalChoice Hosting
Choice Does Matter! | Serving over 26,000 clients
-
06-23-2002, 03:17 PM #11Disabled
- Join Date
- Nov 2001
- Location
- Canada
- Posts
- 1,963
who cares
-
06-23-2002, 03:25 PM #12Web Hosting Master
- Join Date
- Jun 2001
- Location
- Earth
- Posts
- 1,259
Well you'll care a little bit .
Most systems won't have /bin/ksh on them unless you've installed pdksh. And there are syntax differences between /bin/csh, /bin/sh and /bin/bash.
Frank█ Umbra Hosting
█ cPanel | Softaculous | CloudLinux | R1Soft | Ksplice
█ Web Hosting, Reseller Hosting, VPS, Dedicated Servers, Colocation
█ UmbraHosting.com
-
06-23-2002, 04:55 PM #13Web Hosting Evangelist
- Join Date
- May 2002
- Posts
- 542
Originally posted by ffeingol
And there are syntax differences between /bin/csh, /bin/sh and /bin/bash.
Jay » jay@frontdrive.com AIM » FDrive Support
Front Drive™ » Advanced multi-domain solutions
http://www.frontdrive.com/
-
06-24-2002, 05:23 AM #14Junior Guru
- Join Date
- Apr 2002
- Location
- Sacramento, CA
- Posts
- 220
Originally posted by FDrive
Precisely why I use a universal language, Perl, to do all of my scriptingJoel Strellner
-
06-24-2002, 07:07 AM #15Web Hosting Master
- Join Date
- Jun 2001
- Location
- Earth
- Posts
- 1,259
Originally posted by FDrive
Precisely why I use a universal language, Perl, to do all of my scripting
Frank█ Umbra Hosting
█ cPanel | Softaculous | CloudLinux | R1Soft | Ksplice
█ Web Hosting, Reseller Hosting, VPS, Dedicated Servers, Colocation
█ UmbraHosting.com
-
06-24-2002, 07:39 AM #16WHT Addict
- Join Date
- Dec 2000
- Posts
- 113
I just always prefer shellscripting
Leon Mergen
leon@antrophia.com
http://www.antrophia.com/