Topic:   shell scripting   (Read 35316 times)


0 Members and 3 Guests are viewing this topic.

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
shell scripting
« on: November 01, 2011, 05:02:05 PM »
So as you know I've dabbled with shell scripting, trying to make an install script for GM, where you'd hide all of your images, sound, and random files in the application support folder.
I can understand all of it up to the point of locating the files. I found the means,  by copying from Russians ::) (I'm not kidding) the way we won the space race ;D (still not kidding.)

Code: [Select]
#!/bin/sh
cd `echo "$0"|cut -d "/" -f1-3`

My question is

HOW IN THE SEVEN HELLS DOES THAT EVEN WORK!!!
 :-X
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: shell scripting
« Reply #1 on: November 01, 2011, 06:22:55 PM »
Magic

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: shell scripting
« Reply #2 on: November 03, 2011, 03:48:11 PM »
I found one that makes more sense than this.

Code: [Select]
BASEDIR=$(dirname $0)
sets the directory to a variable

Code: [Select]
%~dp0
this returns it on windows.

I can finnish the GM installer for games that want to hide their files in application support.
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to