Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #56473 > unrolled thread

How many ways can you run a script?

Started byWoozy Song <suzyw0ng@outlook.com>
First post2024-05-29 19:15 +0800
Last post2024-05-31 15:08 +0200
Articles 8 — 7 participants

Back to article view | Back to comp.os.linux.misc


Contents

  How many ways can you run a script? Woozy Song <suzyw0ng@outlook.com> - 2024-05-29 19:15 +0800
    Re: How many ways can you run a script? Andy Burns <usenet@andyburns.uk> - 2024-05-29 13:17 +0100
    Re: How many ways can you run a script? Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-05-29 12:26 +0000
    Re: How many ways can you run a script? Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-05-29 12:29 +0000
    Re: How many ways can you run a script? not@telling.you.invalid (Computer Nerd Kev) - 2024-05-30 08:26 +1000
      Re: How many ways can you run a script? Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-05-29 23:12 +0000
      Re: How many ways can you run a script? John-Paul Stewart <jpstewart@personalprojects.net> - 2024-05-29 21:16 -0400
    Re: How many ways can you run a script? immibis <news@immibis.com> - 2024-05-31 15:08 +0200

#56473 — How many ways can you run a script?

FromWoozy Song <suzyw0ng@outlook.com>
Date2024-05-29 19:15 +0800
SubjectHow many ways can you run a script?
Message-ID<v372oq$1462c$1@dont-email.me>
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?

[toc] | [next] | [standalone]


#56474

FromAndy Burns <usenet@andyburns.uk>
Date2024-05-29 13:17 +0100
Message-ID<lboknaFg1fvU1@mid.individual.net>
In reply to#56473
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

[toc] | [prev] | [next] | [standalone]


#56475

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2024-05-29 12:26 +0000
Message-ID<v376tc$14a46$2@dont-email.me>
In reply to#56473
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"

[toc] | [prev] | [next] | [standalone]


#56476

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2024-05-29 12:29 +0000
Message-ID<v3772e$14a46$3@dont-email.me>
In reply to#56473
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"

[toc] | [prev] | [next] | [standalone]


#56477

Fromnot@telling.you.invalid (Computer Nerd Kev)
Date2024-05-30 08:26 +1000
Message-ID<6657ab94@news.ausics.net>
In reply to#56473
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.

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

[toc] | [prev] | [next] | [standalone]


#56478

FromLawrence D'Oliveiro <ldo@nz.invalid>
Date2024-05-29 23:12 +0000
Message-ID<v38cpq$1bce2$3@dont-email.me>
In reply to#56477
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.

[toc] | [prev] | [next] | [standalone]


#56479

FromJohn-Paul Stewart <jpstewart@personalprojects.net>
Date2024-05-29 21:16 -0400
Message-ID<lbq2ahF2sd0U1@mid.individual.net>
In reply to#56477
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.

[toc] | [prev] | [next] | [standalone]


#56484

Fromimmibis <news@immibis.com>
Date2024-05-31 15:08 +0200
Message-ID<v3ci4s$27v7q$1@dont-email.me>
In reply to#56473
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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.os.linux.misc


csiph-web