Frage

Dies ist das erste Mal, dass ich mit dem in Linux und Ankündigung etwas auf Befehl seltsam spielte. Sagen, dass ich diese Test-Datei erstellen:

#!/bin/bash
count=1
echo "count is $count"

dann i Ausgabe

at -f /full/path/to/myscript.sh -v 13:00 -m

und warten, bis es zu laufen. Dann in der Post, ist der Wert der Zählvariable nichts. Was könnte falsch sein?

To: root@localhost.localdomain
Status: R

count is

&
War es hilfreich?

Lösung

Are you sure your commands are being run by bash, and not some other interpreter like csh? I don't think the shebang line has any effect in an at job -- the commands are simply piped into whichever shell is specified via the SHELL environment variable.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top