Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I wrote a shell named t.sh It's content is:

touch 88888

The command I'm using is

sh t.sh | at 03:13Jun15

After I execute this command, I got this show on my screen:

warning: commands will be executed using /bin/sh
job 9 at Sun Jun 15 03:13:00 2014

It shows quite clear that this will be executed at Sun Jun 15 03:13:00 2014

But when I check my folder, and I find a 88888 file exists there. Rmoved it and try agian, still the same result.

What's the problems here? Would it be a bash/sh thing? Because I saw it says will execute by /bin/sh?

share|improve this question

1 Answer 1

up vote 13 down vote accepted

at reads commands from standard input, or from a file if you specify the -f flag. What sh t.sh | at [time] does is:

1. execute the shell script t.sh *right now*; 
2. pipe the output of the shell script to at. 

But the script has no output, so there is nothing to execute on Sunday.

What you want is at 03:13Jun15 -f t.sh.

share|improve this answer
    
Pipes. They still confuse me sometimes. –  Seth Jun 11 at 14:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.