Goonstation Forums
CODING WITH DWAINE - Printable Version

+- Goonstation Forums (https://forum.ss13.co)
+-- Forum: Discussion (https://forum.ss13.co/forumdisplay.php?fid=6)
+--- Forum: General Discussion (https://forum.ss13.co/forumdisplay.php?fid=7)
+--- Thread: CODING WITH DWAINE (/showthread.php?tid=2703)



CODING WITH DWAINE - Chips Ahoy - 06-25-2014

This one goes out to my dwaine junkies, currently pulling my hair.

Here is the current code im workin on, but it isn't working.
#!|necho registered=$arg0|nassignment=$arg1|naccess=11|n^/mnt/term/spoof|n^/home/usrcahoy0/SPOOF

Here is the rundown
#!
#its an executable, the idea is a script within a script to super easily make mulitple identities with mulitple jobs for spoofing other terminals and such

echo
#it echoes because when the player uses the script, it calls another script
registered=$arg0
assignment=$arg1
access=11
^/mnt/term/spoof
#this is the end of the [inner] script, upon running spoof x y, you will get an identity with those credentials sent to your terminal
^
/home/usrcahoy0/spoof
#this is the end of the [outer] script, which saves itself into my folder

What am I doing wrong?
Can you not make script functions within script functions?
Am I just boning the code?

I know the idea is sorta shitty at the moment, but hopefully this could open the door to cooler ideas and much intricate dwaine code.


Re: CODING WITH DWAINE - Dabir - 06-25-2014

The first ^ at the end of the inner script will be taken as the end of the script as a whole. However, a | by itself will be interpreted as a ^ later..


Re: CODING WITH DWAINE - Marquesas - 06-25-2014

Yes, you'll have to realize that there are major differences between lines of code entered directly into a command line and lines of code in a script.


Re: CODING WITH DWAINE - Chips Ahoy - 06-25-2014

So...

echo #!|necho registered=$arg0|nassignment=$arg1|naccess=11 | /mnt/term/spoof|n^/home/usrcahoy0/SPOOFED

would work? Because it returns "Break at line 3"

@Marquesas: I was under the impression that the script was, at least for the shitty things I learned in a basic compsci class, just a streamlined approach at the commandlne. When we were working with python you could in theory solve the problems presented to you at the command line, it would just take fucking forever and be monotonous as all hell, and you'd need to keep notes. In this context, where is my confusion? Am I going about solving this conundrum from the wrong angle?


Re: CODING WITH DWAINE - Marquesas - 06-25-2014

Chips Ahoy Wrote:@Marquesas: I was under the impression that the script was, at least for the shitty things I learned in a basic compsci class, just a streamlined approach at the commandlne. When we were working with python you could in theory solve the problems presented to you at the command line, it would just take fucking forever and be monotonous as all hell, and you'd need to keep notes. In this context, where is my confusion? Am I going about solving this conundrum from the wrong angle?

Your confusion is non-existent, it is the way every interpreter ever works.

Except this one.

I'd much rather check out what you're doing in-game, because your first post confuses me.


Re: CODING WITH DWAINE - Zeef - 06-29-2014

Is DWAINE specified anywhe-- BAHAHAHAHAHAHA


Re: CODING WITH DWAINE - Splatpope - 07-06-2014

this makes bash look fun to script


Re: CODING WITH DWAINE - rulib - 07-15-2014

Quote:>ls /mnt/radio
]Contents of /mnt/radio
]1459

>cat quotest
]#!
]echo $arg0 ^ /mnt/radio/$arg1/foo
]

>quotest butts 1459
]Unable to pipe stream to file.

Any idea what I'm doing wrong here?


Re: CODING WITH DWAINE - Marquesas - 07-15-2014

rulib Wrote:Any idea what I'm doing wrong here?

Likely to be a limitation imposed on the system. Code seems mostly fine. Also, try replacing that ^ (how the hell did you manage to echo a "^" to a file???) with a |.


Re: CODING WITH DWAINE - Zamujasa - 07-16-2014

It might be doing something like not replacing $arg2. And I thnk you can get a ^ by using ^^ (or something equally weird)


Re: CODING WITH DWAINE - Marquesas - 07-16-2014

Further testing shows that apparently varnames are not parsed in the stream redirection.


Re: CODING WITH DWAINE - Marquesas - 07-16-2014

Oh, you can use cd as a replacement, so cd to that path (paths in cd are apparently parsed for variables) and then echo to the file.


Re: CODING WITH DWAINE - Splatpope - 07-18-2014

variable names should always be parsed and only escaped using double quotes but hey lol its not bash so what do I know


Re: CODING WITH DWAINE - Marquesas - 07-20-2014

Splatpope Wrote:variable names should always be parsed and only escaped using single quotes or backslashes but hey lol its not bash so what do I know



Re: CODING WITH DWAINE - Splatpope - 07-24-2014

Marquesas Wrote:
Splatpope Wrote:variable names should always be parsed and only escaped using single quotes or backslashes but hey lol its not bash so what do I know

but it's like a simulation of bash so why not just replicate that behavior