I collect some info, set the amount of hours in a variable and then try to use this variable to set the at job.
A shortened version of the script (with the same result) goes as follows:
When I run that, I get this: syntax error. Last token seen: hours
Garbled time
I have tried everything I could think of to put it differently:
- put quotes from now to hours
- use the at -f <script> <time> format
- put <now + $NROFHOURS hours> in one variable
- ...
None would work.
Do you guys have any idea please?
Thanks,
Koen
Last edited by Scott; 08-16-2011 at 05:36 AM..
Reason: Code tags
Thanks! That seemed to work (and it's simpler). Unfortunately I cannot directly use it in my script: here's what I'm doing:
Would you know how to get around this?
Cheers
---------- Post updated at 12:22 AM ---------- Previous update was at 12:19 AM ----------
Anyone please?
When I run the above code, I get this:
Last edited by Scott; 08-16-2011 at 05:37 AM..
Reason: Please use code tags
Hello,
I need to run multiple shell processes simultaneously and output of the first process shall be the input of the second process but first process is never ending so both should be running in parallel. I do not wish to wait the end of the first process. I am under ubuntu 16.04.
... (3 Replies)
i want to change user to "root" from another user while running a script. how can i automatically feed the password? for example, i want to write a script say "script.sh"... it will first run the command "p" as mhmn user, and then it will change the user to "root" by using "su - root" command. at... (1 Reply)
Hello, everyone. I am working wtihin AIX 5.3, and I need to do the following:
read the each line of file BASE.txt
do XK {line contents}
if XK's output begins with "BASE", then append line contents to file "output.txt"
continue until end of file
Here is what I tried(unsuccessfuly):
... (4 Replies)
Dear all,
I want to write a shell script to easy my job. Here is the description of task:
I have several files (d1.log, d2.log, d3.log etc)
with the common text as
=======using photon counter ======
tot pho is = 29596
nomatch pho is = 1350
phoeta pho is = 1220... (11 Replies)
Hello
I am doing some test.
In a script I have to call a change password routine ( ldap ) which ask confirmation. This can be done from terminal.
Is there a way to do something like this :
#!/bin/bash
#
blabla
blabla
blabla
blabla
# changing_password_routine user_name... (2 Replies)
Hi,
like if i want to authenticate and i 100% know the password and username
i can run a script with
su - username
and then feed in the password through file pass.txt
script.sh < pass.txt
but if i don't know in which order the script is going to prompt for the input is there a way i... (4 Replies)
Hi all,
I need a little assistance to complete the following script. I would like to take a file with a single number on each line and for each number, run it through a command. The loop will terminate once all numbers have been checked. Here is what I have thus far...
COUNTER=`wc -l... (2 Replies)
Hi,
I am having set of files whose names are stored in a file say "filelist.txt"
Now, I want to find all files contained in "filelist.txt" from my parent directory.
Is there any way to let find command understand "filelist.txt" just like we have option -f in awk.
I donot want to run a... (4 Replies)
Hi, I'm having difficulty in making a bash script to get netcat to scan a list of hosts and their ports from another file and could use some help. Here's an example host list, "nc.host":
192.168.2.110 22
And here's the first script I tried to feed "nc.host" into netcat:
"nc1.sh"
... (3 Replies)
I'm trying to get a partial file path by passing the part I want removed to sed. Sed gets garbled when I try multiple directories (i.e. because of the extra slash).
For example:
FULLFILEPATH="usr/local/bin"
STRIPDIR="usr"
PARTFILEPATH=`echo $FULLFILEPATH | sed s/\${STRIPDIR}//`
Gives me... (3 Replies)