01-07-2009
Ambiguous output redirect error
Hi everyone, While I was trying to do
DATE=`date +"%Y%m%d_%H%M%S"`
STARTLOG=$TUXSTDDIR/start_$DATE.log
tmboot -y > $STARTLOG 2>&1
I got an error i.e. Ambiguous output redirect error. Here the first part is to boot the account so there is nothing wrong with that. I have defined the startlog also but I dint understand why I am having problem here.
I dint get what that error means. I will appreciate any help to make this right.
thanks alot
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i have following statement in the script
echo -e "$str_XML_col_name:$str_field_type;" >> $i_DC_Key_$i_Tgt_DC_key_Schema
here $i_DC_Key is DC key and $i_Tgt_DC_key are the variables...............
when i ran the script i am getting error rec_merge.sh: $i_DC_Key_$i_Tgt_DC_key_Schema:... (1 Reply)
Discussion started by: mahabunta
1 Replies
2. Shell Programming and Scripting
hi,
i want to redirect my output & error if generated to two different files. I
have written the code for redirecting the output, i dnt have ne idea how to
go abt it for errors. I tried spooling which was given in one of the
threads on this forum.But it didn't work.The script i wrote as a lot... (4 Replies)
Discussion started by: bankimmehta
4 Replies
3. Shell Programming and Scripting
Hi Everyone,
# ll
total 0
-rw-r--r-- 1 root root 0 2010-05-13 11:29 a1.log
-rw-r--r-- 1 root root 0 2010-05-13 11:29 a2.log
-rw-r--r-- 1 root root 0 2010-05-13 11:29 a3.log
# rm a.log
above rm no problem, but when i use "> a.log", it says "-bash: a.log: ambiguous redirect".
... (3 Replies)
Discussion started by: jimmy_y
3 Replies
4. UNIX for Dummies Questions & Answers
I am trying to run the following script and I am getting an "ambiguous redirect" error. I have checked to make sure that the files are all where I have specified and are read/write as needed. Any ideas?
Note: I have removed the actual path info for privacy sake. I have triple checked to make... (1 Reply)
Discussion started by: malantha
1 Replies
5. Shell Programming and Scripting
Hello there,
I'm totally new in bash programming and ran into my first problem.
My script should generate 3 textfiles where the content of the first and the third row are the same in each file. Only the second row is different.
This is what I did in a very simplified explanation:
... (6 Replies)
Discussion started by: johndoe
6 Replies
6. Shell Programming and Scripting
This script has ambiguous redirect error.
...
cd $HOME
cd folder/work
# search all subfolders in work directory
find -mindepth 1 -maxdepth 1 -type d | while read directory
do
CUR_FOLDER="${directory#"./"}"
cd $CUR_FOLDER
chmod 644 *
for ff in *; do
if ; then
... (5 Replies)
Discussion started by: candyme
5 Replies
7. Shell Programming and Scripting
I came across the command string on https://www.unix.com/shell-programming-scripting/141885-awk-removing-data-before-after-pattern.html which was what I was looking for to be able to remove data before a certain pattern. However, outputting the result to a file seems to work on an individual basis... (4 Replies)
Discussion started by: HLee1981
4 Replies
8. Linux
Hi,
I need help on following linux bash script. When I linux commands for loop or while loop on individual file it runs great. but now I want the script to run on N number of files so it gives me ambiguous redirect error on line 12 and syntax error on line 22 : (pls help );
#!/bin/bash
#... (16 Replies)
Discussion started by: Madhusudan Das
16 Replies
9. Shell Programming and Scripting
Hi all,
I've been working on a bash script to help with backups that I have to do at work.
One of the lines in the script is supposed to launch an xterm, log into a specific server node and launch a tar backup to tape. This part works ok, but I've been trying to get stdout and stderr to... (2 Replies)
Discussion started by: Exitalterego
2 Replies
10. Shell Programming and Scripting
New to the site, please let me know I'm not meeting the post guidelines.
I'm creating a bash script to generate a report with output from a grep command. The goal is to direct
the output to a different log file by using a 'logger file'. But I get this error during the run: $1: ambiguous... (5 Replies)
Discussion started by: dallas88
5 Replies
DATE(1) BSD General Commands Manual DATE(1)
NAME
date -- display or set date and time
SYNOPSIS
date [-ajnu] [-d date] [-r seconds] [+format] [[[[[[CC]yy]mm]dd]HH]MM[.SS]]
DESCRIPTION
date displays the current date and time when invoked without arguments. Providing arguments will format the date and time in a user-defined
way or set the date. Only the superuser may set the date.
The options are as follows:
-a Use adjtime(2) to change the local system time slowly, maintaining it as a monotonically increasing function. -a implies -n.
-d date
Parse the provided human-described date and time and display the result without actually changing the system clock. (See
parsedate(3) for examples.)
-j Parse the provided canonical representation of date and time (described below) and display the result without actually changing the
system clock.
-n The utility timed(8) is used to synchronize the clocks on groups of machines. By default, if timed is running, date will set the
time on all of the machines in the local group. The -n option stops date from setting the time for other than the current machine.
-r seconds
Print out the date and time that is seconds from the Epoch.
-u Display or set the date in UTC (universal) time.
An operand with a leading plus (+) sign signals a user-defined format string which specifies the format in which to display the date and
time. The format string may contain any of the conversion specifications described in the strftime(3) manual page, as well as any arbitrary
text. A <newline> character is always output after the characters specified by the format string. The format string for the default display
is:
%a %b %e %H:%M:%S %Z %Y
If an operand does not have a leading plus sign, it is interpreted as a value for setting the system's notion of the current date and time.
The canonical representation for setting the date and time is:
CC The first two digits of the year (the century).
yy The second two digits of the year. If yy is specified, but CC is not, a value for yy between 69 and 99 results in a CC value
of 19. Otherwise, a CC value of 20 is used.
mm The month of the year, from 01 to 12.
dd The day of the month, from 01 to 31.
HH The hour of the day, from 00 to 23.
MM The minute of the hour, from 00 to 59.
SS The second of the minute, from 00 to 61.
Everything but the minutes is optional.
Time changes for Daylight Saving and Standard time and leap seconds and years are handled automatically.
ENVIRONMENT
The following environment variables affect the execution of date:
TZ The timezone to use when displaying dates. See environ(7) for more information.
FILES
/etc/localtime Symlink pointing to system's default timezone information file in /usr/share/zoneinfo directory.
/var/log/wtmp A record of date resets and time changes.
/var/log/messages A record of the user setting the time.
EXAMPLES
The command:
date '+DATE: %m/%d/%y%nTIME: %H:%M:%S'
will display:
DATE: 11/21/87
TIME: 13:36:16
The command:
date 8506131627
sets the date to ``June 13, 1985, 4:27 PM''.
The command:
date 1432
sets the time to 2:32 PM, without modifying the date.
DIAGNOSTICS
Exit status is 0 on success, 1 if unable to set the date, and 2 if able to set the local date, but unable to set it globally.
Occasionally, when timed(8) synchronizes the time on many hosts, the setting of a new time value may require more than a few seconds. On
these occasions, date prints: 'Network time being set'. The message 'Communication error with timed' occurs when the communication between
date and timed fails.
SEE ALSO
adjtime(2), gettimeofday(2), settimeofday(2), parsedate(3), strftime(3), utmp(5), timed(8)
R. Gusella and S. Zatti, TSP: The Time Synchronization Protocol for UNIX 4.3BSD.
STANDARDS
The date utility is expected to be compatible with IEEE Std 1003.2 (``POSIX.2'').
BSD
November 15, 2006 BSD