Skip to main content
Post Undeleted by animuson
Post Unlocked by animuson
Post Locked by CommunityBot
Post Deleted by CommunityBot
Notice removed Improve details by Arcticooling
Bounty Ended with Peter Cordes's answer chosen by Arcticooling
added 30 characters in body
Source Link
Arcticooling
  • 4.5k
  • 18
  • 56
  • 107

I use Ubuntu server 16.04 and I desire to use the utility at in my current session to do something 1 minute from now (say, an echo), without giving a specific date and time - just 1 minute ahead from current time.

This failed:

echo 'hi' | at 1m 

The reason I choose at over sleep is because sleep handicaps current session and is therefor more suitable to delay commands in otheranother session, rather than the one we work with most of the time. AFAIR, at doesn't behave this way and won't handicap my session.

Update_1

By Pied Piper's answer, I've tried:

(sleep 1m; echo 'hi') & 

I have a small problem with this method: The "hi" stream is printed ininside my primary prompt (in the stdin) and not in my stdoutalso adds an empty secondary prompt (as it would with a regular echo_) right under the primary prompt that contains it, see:

USER@:~# (sleep 1m; echo 'hi') & [1] 22731 USER@:~# hi ^C [1]+ Done 

Update_2

By Peter Corde's answer I tried:

(sleep 2 && echo -e '\nhi' && kill -WINCH $$ &) 

This works properly in Bash 4.4, but not in some older versions, seemingly (see comments in the answer). I personally use Bash 4.3 in my own environments.

I use Ubuntu server 16.04 and I desire to use the utility at in my current session to do something 1 minute from now (say, an echo), without giving a specific date and time - just 1 minute ahead from current time.

This failed:

echo 'hi' | at 1m 

The reason I choose at over sleep is because sleep handicaps current session and is therefor more suitable to delay commands in other session rather than the one we work with most of the time. AFAIR, at doesn't behave this way and won't handicap my session.

Update_1

By Pied Piper's answer, I've tried:

(sleep 1m; echo 'hi') & 

I have a small problem with this method: The "hi" stream is printed in my prompt (in the stdin) and not in my stdout (as it would with a regular echo):

USER@:~# (sleep 1m; echo 'hi') & [1] 22731 USER@:~# hi ^C [1]+ Done 

Update_2

By Peter Corde's answer I tried:

(sleep 2 && echo -e '\nhi' && kill -WINCH $$ &) 

This works properly in Bash 4.4, but not in some older versions, seemingly (see comments in the answer). I personally use Bash 4.3 in my own environments.

I use Ubuntu server 16.04 and I desire to use the utility at in my current session to do something 1 minute from now (say, an echo), without giving a specific date and time - just 1 minute ahead from current time.

This failed:

echo 'hi' | at 1m 

The reason I choose at over sleep is because sleep handicaps current session and is therefor more suitable to delay commands in another session, rather than the one we work with most of the time. AFAIR, at doesn't behave this way and won't handicap my session.

Update_1

By Pied Piper's answer, I've tried:

(sleep 1m; echo 'hi') & 

I have a problem with this method: The "hi" stream is printed inside my primary prompt and also adds an empty secondary prompt (_) right under the primary prompt that contains it, see:

USER@:~# (sleep 1m; echo 'hi') & [1] 22731 USER@:~# hi ^C [1]+ Done 

Update_2

By Peter Corde's answer I tried:

(sleep 2 && echo -e '\nhi' && kill -WINCH $$ &) 

This works properly in Bash 4.4, but not in some older versions, seemingly (see comments in the answer). I personally use Bash 4.3 in my own environments.

added 32 characters in body
Source Link
Arcticooling
  • 4.5k
  • 18
  • 56
  • 107

I wantuse Ubuntu server 16.04 and I desire to use the utility at in my current session to do something 1 minute from now (say, an echo), without giving a specific date and time - just 1 minute ahead from current time.

This failed:

echo 'hi' | at 1m 

The reason I choose at over sleep is because sleep handicaps current session and is therefor more suitable to delay commands in other session rather than the one we work with most of the time. AFAIR, at doesn't behave this way and won't handicap my session.

Update_1

By Pied Piper's answer, I've tried:

(sleep 1m; echo 'hi') & 

I have a small problem with this method: The "hi" stream is printed in my prompt (in the stdin) and not in my stdout (as it would with a regular echo):

USER@:~# (sleep 1m; echo 'hi') & [1] 22731 USER@:~# hi ^C [1]+ Done 

Update_2

By Peter Corde's answer I tried:

(sleep 2 && echo -e '\nhi' && kill -WINCH $$ &) 

This works properly in Bash 4.4, but not in some older versions, seemingly (see comments in the answer). I personally use Bash 4.3 in my own environments.

I want to use the utility at in my current session to do something 1 minute from now (say, an echo), without giving a specific date and time - just 1 minute ahead from current time.

This failed:

echo 'hi' | at 1m 

The reason I choose at over sleep is because sleep handicaps current session and is therefor more suitable to delay commands in other session rather than the one we work with most of the time. AFAIR, at doesn't behave this way and won't handicap my session.

Update_1

By Pied Piper's answer, I've tried:

(sleep 1m; echo 'hi') & 

I have a small problem with this method: The "hi" stream is printed in my prompt (in the stdin) and not in my stdout (as it would with a regular echo):

USER@:~# (sleep 1m; echo 'hi') & [1] 22731 USER@:~# hi ^C [1]+ Done 

Update_2

By Peter Corde's answer I tried:

(sleep 2 && echo -e '\nhi' && kill -WINCH $$ &) 

This works properly in Bash 4.4, but not in some older versions, seemingly (see comments in the answer). I personally use Bash 4.3 in my own environments.

I use Ubuntu server 16.04 and I desire to use the utility at in my current session to do something 1 minute from now (say, an echo), without giving a specific date and time - just 1 minute ahead from current time.

This failed:

echo 'hi' | at 1m 

The reason I choose at over sleep is because sleep handicaps current session and is therefor more suitable to delay commands in other session rather than the one we work with most of the time. AFAIR, at doesn't behave this way and won't handicap my session.

Update_1

By Pied Piper's answer, I've tried:

(sleep 1m; echo 'hi') & 

I have a small problem with this method: The "hi" stream is printed in my prompt (in the stdin) and not in my stdout (as it would with a regular echo):

USER@:~# (sleep 1m; echo 'hi') & [1] 22731 USER@:~# hi ^C [1]+ Done 

Update_2

By Peter Corde's answer I tried:

(sleep 2 && echo -e '\nhi' && kill -WINCH $$ &) 

This works properly in Bash 4.4, but not in some older versions, seemingly (see comments in the answer). I personally use Bash 4.3 in my own environments.

Notice added Improve details by Arcticooling
Bounty Started worth 100 reputation by Arcticooling
edited body
Source Link
Arcticooling
  • 4.5k
  • 18
  • 56
  • 107

at 2 hourssome time from now do XYZsomething (and maybe also show result in console)

I want to use the utility at in my current session to do something 1 minute from now (say, an echo), without giving a specific date and time - just 1 minute ahead from current time.

This failed:

echo 'hi' | at 1m 

The reason I choose at over sleep is because sleep handicaps current session and is therefor more suitable to delay commands in other session rather than the one we work with most of the time. AFAIR, at doesn't behave this way and won't handicap my session.

Update_1

By Pied Piper's answer, I've tried:

(sleep 1m; echo 'hi') & 

I have a small problem with this method: The "hi" stream is printed in my prompt (in the stdin) and not in my stdout (as it would with a regular echo):

USER@:~# (sleep 1m; echo 'hi') & [1] 22731 USER@:~# hi ^C [1]+ Done 

Update_2

By Peter Corde's answer I tried:

(sleep 2 && echo -e '\nhi' && kill -WINCH $$ &) 

But thisThis works properly in Bash 4.4, but not some in some older versions, seemingly (see comments in the answer). I personally use Bash 4.3 in my own environments.

at 2 hours from now do XYZ

I want to use the utility at in my current session to do something 1 minute from now (say, an echo), without giving a specific date and time - just 1 minute ahead from current time.

This failed:

echo 'hi' | at 1m 

The reason I choose at over sleep is because sleep handicaps current session and is therefor more suitable to delay commands in other session rather than the one we work with most of the time. AFAIR, at doesn't behave this way and won't handicap my session.

Update_1

By Pied Piper's answer, I've tried:

(sleep 1m; echo 'hi') & 

I have a small problem with this method: The "hi" stream is printed in my prompt (in the stdin) and not in my stdout (as it would with a regular echo):

USER@:~# (sleep 1m; echo 'hi') & [1] 22731 USER@:~# hi ^C [1]+ Done 

Update_2

By Peter Corde's answer I tried:

(sleep 2 && echo -e '\nhi' && kill -WINCH $$ &) 

But this works properly in Bash 4.4, not some in older versions, seemingly (see comments in the answer). I personally use Bash 4.3 in my own environments.

at some time from now do something (and maybe also show result in console)

I want to use the utility at in my current session to do something 1 minute from now (say, an echo), without giving a specific date and time - just 1 minute ahead from current time.

This failed:

echo 'hi' | at 1m 

The reason I choose at over sleep is because sleep handicaps current session and is therefor more suitable to delay commands in other session rather than the one we work with most of the time. AFAIR, at doesn't behave this way and won't handicap my session.

Update_1

By Pied Piper's answer, I've tried:

(sleep 1m; echo 'hi') & 

I have a small problem with this method: The "hi" stream is printed in my prompt (in the stdin) and not in my stdout (as it would with a regular echo):

USER@:~# (sleep 1m; echo 'hi') & [1] 22731 USER@:~# hi ^C [1]+ Done 

Update_2

By Peter Corde's answer I tried:

(sleep 2 && echo -e '\nhi' && kill -WINCH $$ &) 

This works properly in Bash 4.4, but not in some older versions, seemingly (see comments in the answer). I personally use Bash 4.3 in my own environments.

added 236 characters in body
Source Link
Arcticooling
  • 4.5k
  • 18
  • 56
  • 107
Loading
Tweeted twitter.com/StackUnix/status/937866286822055936
added 4 characters in body
Source Link
Arcticooling
  • 4.5k
  • 18
  • 56
  • 107
Loading
added 319 characters in body
Source Link
Arcticooling
  • 4.5k
  • 18
  • 56
  • 107
Loading
Source Link
Arcticooling
  • 4.5k
  • 18
  • 56
  • 107
Loading