Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #369: Virus transmitted from computer to sysadmins.


comp / comp.os.linux.misc / How many ways can you run a script?

SubjectAuthor
* How many ways can you run a script?Woozy Song
+- Re: How many ways can you run a script?immibis
+* Re: How many ways can you run a script?Computer Nerd Kev
|+- Re: How many ways can you run a script?John-Paul Stewart
|`- Re: How many ways can you run a script?Lawrence D'Oliveiro
+- Re: How many ways can you run a script?Lew Pitcher
+- Re: How many ways can you run a script?Lew Pitcher
`- Re: How many ways can you run a script?Andy Burns

1
Subject: How many ways can you run a script?
From: Woozy Song
Newsgroups: comp.os.linux.misc
Organization: A noiseless patient Spider
Date: Wed, 29 May 2024 11:15 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: suzyw0ng@outlook.com (Woozy Song)
Newsgroups: comp.os.linux.misc
Subject: How many ways can you run a script?
Date: Wed, 29 May 2024 19:15:34 +0800
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <v372oq$1462c$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 29 May 2024 13:15:39 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="138803167533e87a928aef334421a476";
logging-data="1185868"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18hpcULOkct03iJEiFqt6iUO6ZQpD0X//Y="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18.2
Cancel-Lock: sha1:SkflhhND7qKctOmoIEb3iUTWMKI=
X-Mozilla-News-Host: news://news.eternal-september.org:119
View all headers

sh script
bash script
source script
taskset FF script
rsh localhost script
ssh localhost script
xterm -e script
nohup script

I know these are not all equivalent and may have idiosyncracies.
Any others?

Subject: Re: How many ways can you run a script?
From: Andy Burns
Newsgroups: comp.os.linux.misc
Date: Wed, 29 May 2024 12:17 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@andyburns.uk (Andy Burns)
Newsgroups: comp.os.linux.misc
Subject: Re: How many ways can you run a script?
Date: Wed, 29 May 2024 13:17:40 +0100
Lines: 16
Message-ID: <lboknaFg1fvU1@mid.individual.net>
References: <v372oq$1462c$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net UkTh/KKBvIOAQb9h1ShGaQVyKmgnIs39iWH/Ed+QBgYUSHs7FM
Cancel-Lock: sha1:69x9reJHVSh++LLLkNTCFFNVZho= sha256:OGzKhqhNL2HDBDZ+NurkEyAP4oHR6585YGhXdhD4D04=
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <v372oq$1462c$1@dont-email.me>
View all headers

Woozy Song wrote:

> sh script
> bash script
> source script
> taskset FF script
> rsh localhost script
> ssh localhost script
> xterm -e script
> nohup script
>
> I know these are not all equivalent and may have idiosyncracies.
> Any others?

.. script

Subject: Re: How many ways can you run a script?
From: Lew Pitcher
Newsgroups: comp.os.linux.misc
Organization: A noiseless patient Spider
Date: Wed, 29 May 2024 12:26 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitcher@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.os.linux.misc
Subject: Re: How many ways can you run a script?
Date: Wed, 29 May 2024 12:26:20 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <v376tc$14a46$2@dont-email.me>
References: <v372oq$1462c$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 29 May 2024 14:26:20 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="addc4a28d9fbe809e2a38ec28a140433";
logging-data="1190022"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX199MeTjmlB2BDiHaDvKvhVKNvgPdUhseJ4="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:rKDquLOqQpenhm46tFSWyL0UEe8=
View all headers

On Wed, 29 May 2024 19:15:34 +0800, Woozy Song wrote:

> sh script
> bash script
> source script
> taskset FF script
> rsh localhost script
> ssh localhost script
> xterm -e script
> nohup script
>
> I know these are not all equivalent and may have idiosyncracies.
> Any others?

Of course, these all use the compiled-language functions to
run scripts. So, let's include (the C API) lower-level functions:
system("script");
popen("script",...);
if (fork() == 0) execl("script",...); else wait(void);

HTH
--
Lew Pitcher
"In Skills We Trust"

Subject: Re: How many ways can you run a script?
From: Lew Pitcher
Newsgroups: comp.os.linux.misc
Organization: A noiseless patient Spider
Date: Wed, 29 May 2024 12:29 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitcher@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.os.linux.misc
Subject: Re: How many ways can you run a script?
Date: Wed, 29 May 2024 12:29:02 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <v3772e$14a46$3@dont-email.me>
References: <v372oq$1462c$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 29 May 2024 14:29:02 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="addc4a28d9fbe809e2a38ec28a140433";
logging-data="1190022"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18bn03nAjdHMYUKORfoX+sRi+jUlp2jbpc="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:BeYimbSj9KCK/9FBKfuEYw0txu4=
View all headers

On Wed, 29 May 2024 19:15:34 +0800, Woozy Song wrote:

> sh script
> bash script
> source script
> taskset FF script
> rsh localhost script
> ssh localhost script
> xterm -e script
> nohup script
>
> I know these are not all equivalent and may have idiosyncracies.
> Any others?

at -f script timespec
crontab
sysvinit inittab or systemd configuration
~/.profile
~/.bashrc

--
Lew Pitcher
"In Skills We Trust"

Subject: Re: How many ways can you run a script?
From: Computer Nerd Kev
Newsgroups: comp.os.linux.misc
Organization: Ausics - https://newsgroups.ausics.net
Date: Wed, 29 May 2024 22:26 UTC
References: 1
Message-ID: <6657ab94@news.ausics.net>
From: not@telling.you.invalid (Computer Nerd Kev)
Subject: Re: How many ways can you run a script?
Newsgroups: comp.os.linux.misc
References: <v372oq$1462c$1@dont-email.me>
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/2.4.31 (i586))
NNTP-Posting-Host: news.ausics.net
Date: 30 May 2024 08:26:29 +1000
Organization: Ausics - https://newsgroups.ausics.net
Lines: 33
X-Complaints: abuse@ausics.net
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.bbs.nz!news.ausics.net!not-for-mail
View all headers

Woozy Song <suzyw0ng@outlook.com> wrote:
> sh script
> bash script
> source script
> taskset FF script
> rsh localhost script
> ssh localhost script
> xterm -e script
> nohup script
>
> I know these are not all equivalent and may have idiosyncracies.
> Any others?

Are you serious? This question is way to vague to get an accurate
and useful answer. If I take it from the information provided that
it could be any Linux system with any known software installed and
running, then you must consider things like a web server serving
script output via CGI, and therefore every program that can make
requests to a Web server running on localhost.

Your list already assumes an RSH, SSH, and X server running, so a
Web server isn't much less likely, and then there are lots more
protocols. Telnet of course, if you pipe in the command to run, and
Rexec. Also various SSH clients, Dropbear, PuTTY, Mosh... Surely
you know there are many alternatives to Xterm that support running
commands?

That's on top of the innumerable programs that one way or other
could launch a script only on the local system.

--
__ __
#_ < |\| |< _#

Subject: Re: How many ways can you run a script?
From: Lawrence D'Oliv
Newsgroups: comp.os.linux.misc
Organization: A noiseless patient Spider
Date: Wed, 29 May 2024 23:12 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.os.linux.misc
Subject: Re: How many ways can you run a script?
Date: Wed, 29 May 2024 23:12:59 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <v38cpq$1bce2$3@dont-email.me>
References: <v372oq$1462c$1@dont-email.me> <6657ab94@news.ausics.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 30 May 2024 01:12:59 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="26c065b9f57d6a6f7be8cfe25ea33754";
logging-data="1421762"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19oCgiDcQq0odkxXkN1NjgP"
User-Agent: Pan/0.158 (Avdiivka; )
Cancel-Lock: sha1:eeoHxjLebCWohACzZzdebQjaWV8=
View all headers

On 30 May 2024 08:26:29 +1000, Computer Nerd Kev wrote:

> Your list already assumes an RSH, SSH, and X server running, so a Web
> server isn't much less likely ...

Talking about Web servers, I was once called in to look at a bunch of cron
tasks set up by a PHP programmer who clearly had no clue about shell
scripts. Here’s what they did:

* Installed some PHP framework that mapped URL paths to PHP functions, so
these could be individually invoked via curl;
* Defined those PHP functions to spawn the necessary shell commands;
* Define the cron tasks to use curl commands to the Web server with the
necessary URL paths to invoke those PHP functions.

The framework (not counting the Web server and PHP itself) was several
thousand lines of PHP code, just to invoke a few lines’ worth of commands.

Subject: Re: How many ways can you run a script?
From: John-Paul Stewart
Newsgroups: comp.os.linux.misc
Date: Thu, 30 May 2024 01:16 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: jpstewart@personalprojects.net (John-Paul Stewart)
Newsgroups: comp.os.linux.misc
Subject: Re: How many ways can you run a script?
Date: Wed, 29 May 2024 21:16:01 -0400
Lines: 25
Message-ID: <lbq2ahF2sd0U1@mid.individual.net>
References: <v372oq$1462c$1@dont-email.me> <6657ab94@news.ausics.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Trace: individual.net hkDz3Hf6b994S0atvQANIgO56FJ6vAom194JPMjI/yHNQcev4G
Cancel-Lock: sha1:lSMHbM2Lr0CD2oz+vWc8YiVLxtE= sha256:sUcW+rx/WvkfZ/G2EA13IBoan35wVDN5SLGkFdyo4kk=
User-Agent: Mozilla Thunderbird
Content-Language: en-CA
In-Reply-To: <6657ab94@news.ausics.net>
View all headers

On 2024-05-29 6:26 p.m., Computer Nerd Kev wrote:
> Woozy Song <suzyw0ng@outlook.com> wrote:
>> sh script
>> bash script
>> source script
>> taskset FF script
>> rsh localhost script
>> ssh localhost script
>> xterm -e script
>> nohup script
>>
>> I know these are not all equivalent and may have idiosyncracies.
>> Any others?
>
> Are you serious? This question is way to vague to get an accurate
> and useful answer.
[snip]
> That's on top of the innumerable programs that one way or other
> could launch a script only on the local system.

Not to mention all the other available shells beyond sh and bash such as
dash, ksh and family, csh and family (which may actually be required,
depending on script syntax), zsh. And those are just the ones I can
think of off the top of my head.

Subject: Re: How many ways can you run a script?
From: immibis
Newsgroups: comp.os.linux.misc
Organization: A noiseless patient Spider
Date: Fri, 31 May 2024 13:08 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: news@immibis.com (immibis)
Newsgroups: comp.os.linux.misc
Subject: Re: How many ways can you run a script?
Date: Fri, 31 May 2024 15:08:44 +0200
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <v3ci4s$27v7q$1@dont-email.me>
References: <v372oq$1462c$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 31 May 2024 15:08:44 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b911487e33b1d0078ab1098fd0a19e69";
logging-data="2358522"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19NrNt1F/ubGhVYZIxAZ7JO"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:A57maGzljKmqI/zlA12qqcGWBo8=
In-Reply-To: <v372oq$1462c$1@dont-email.me>
Content-Language: en-US
View all headers

On 29/05/24 13:15, Woozy Song wrote:
> sh script
> bash script
> source script
> taskset FF script
> rsh localhost script
> ssh localhost script
> xterm -e script
> nohup script
>
> I know these are not all equivalent and may have idiosyncracies.
> Any others?

This reminds me of my favourite script of all time:

#!/bin/rm

1

rocksolid light 0.9.8
clearnet tor