Home
Blogs
Questions

Home

About Us

Blogs

Questions

Monetize

Post Job

banner

Questions about subshell

Read more about subshell

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - subshell

Running 'bash -i' in re-invoked script (via sudo -S) exits immediately - why?

When I launch the following script, it restarts as root, the new bash shell opens up, but "something" sends an "exit" command immediately and the script runs to its end. #!/bin/bas...
test-img

Holger Pandel

bash

sudo

subshell

Votes: 0

Answers: 0

test-img

Make cannot be called from script without sourcing the script

I want to call the make command from a bash script in a MinGW bash shell. However the script seems to know "make" only when I call the script using source: build.sh: #!/bin/bash make all Ca...
test-img

user17949438

bash

makefile

mingw

subshell

Votes: 0

Answers: 0

test-img

Running commands in a loop without spawning a new subshell each time

I have a bash script that reads in lots of dates in epoch time, and determines the (local) hour of the day at which they occurred. Relevant snippet: while read ts do hour="$(date -d@$((${ts} / ...
test-img

chiastic-security

linux

bash

performance

shell

subshell

linux

bash

performance

shell

subshell

Votes: 0

Answers: 1

Latest Answer

Use printf: printf -v hour '%(%H)T' "$(( ts / 1000 ))" Type help printf to know more about the command. Also check strftime(3). Behavior may depend on the value of TZ and LC_TIME.
test-img

konsolebox

Posts

Questions

Blogs

Where knowledge meets opportunity!

About

  • Company
  • Monetize your knowledge
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved