/*it's been a while since i coded in as2, so there may be some mishmash with declaring variables.
however, if it ends up not working just delete ,"var," and the datatype declaration ":Boolean" or ":int" and :etc.*/
function runStoryorWhateverYouWannaCallYourFx(storyNumber:int){
switch(true){
case _root.sex==2: //_root.sex can be "male" or 2 depending on the datatype you decide to use;
spriteInstanceName.gotoAndStop(_root.sex)
story.gotoAndStop(storyNumber);
case _root.sex==1:
spriteInstanceName.gotoAndStop(_root.sex)
story.gotoAndStop(storyNumber);
case _root.sex==0:
spriteInstanceName.gotoAndStop(_root.sex)
story.gotoAndStop(storyNumber);
}
}
Terrantor!!! Wrote:What's Bash?
find / | grep myfile.txt | xargs rm
//this looks through the entire system (/ and all subdirectories), sends all of the file paths to grep, which checks if they contain the string "myfile.txt". Anything that satisfies this gets sent to the program "rm", which removes it from the system.
diff oldfile newfile -u > temppatch; patch patchme < temppatch; rm temppatch
//Use the differences between oldfile and newfile to create a patch between them, then apply that patch to patchme, then remove the patch file.
"myscript.sh"
#! /bin/bash
d=date --iso-8601
if [ $(ls | grep $1) -n] then
cp $1 ~/archive/$d.$1
python ~/bin/myscript.py -c $1
fi
//a little script that runs a python script on the file you specify (by running "myscript.sh myfile") and archives it (using iso-8601 date format, i.e. 2014-08-14.myfile).
hat973 Wrote:just the .sh bit i dont understand is that flash or not
hat973 Wrote:idk what bash is like 100% do not know
Zeus Kabob Wrote:Terrantor!!! Wrote:What's Bash?
Just the best shell ever. The Bourne-again Shell (Bash) is the successor to the Bourne Shell (sh), and it's a command-line interpreter (cli) that has full scripting capabilities and uses a system $PATH variable to locate and run executable programs and using the unix/linux stdin, stdout, and stderr to redirect program input and output through the scripting process.
At the end of the day, it allows you to do cool stuff like search your entire filesystem for a specific filename, search a directory for every file with a certain thing in it, and some other cool things.
Zeus Kabob Wrote:If you've ever used the DOS COMMAND.COM cli or the modern windows cmd.exe command line, Bash is very similar to those. In Mac, the program called "Terminal" runs Bash.
Users browsing this forum: No registered users