Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Redirection not working as expected Post 302214670 by findprakash on Monday 14th of July 2008 03:35:58 PM
Old 07-14-2008
Redirection not working as expected

Portion of my script below :

if [ ${TODAYDAY} = "Mon" ]; then
NUMBEROFFEILDS=`cat ${BASE_SCRIPT_LOC}/standardfilecleanup.lst|grep -w ${db_file_path}|awk -F: '{print NF}'`
COUNT=4
while [ ${COUNT} -le ${NUMBEROFFEILDS} ]; do
awk_var="$"`echo $COUNT`
file_name1=`cat ${BASE_SCRIPT_LOC}/standardfilecleanup.lst|grep -w ${DATABASE_PARAM}|awk -F: '{print '$awk_var'}'`
file_name=`eval echo $file_name1`
cp -rp ${DATABASE_PARAM_PATH}/${file_name} ${DATABASE_PARAM_PATH}/${file_name}_${TODAYDATE}
echo > ${DATABASE_PARAM_PATH}/${file_name}
gzip ${DATABASE_PARAM_PATH}/${file_name}_${TODAYDATE}
COUNT=`expr $COUNT + 1`
done
else
echo "\n Today is my rest day!!\n"
fi


Code is erroring out at -

echo > ${DATABASE_PARAM_PATH}/${file_name}

Error Message below :

+ echo
+ ./manageOSfiles.ksh_orig[82]: ^J/pgmfggptc/app/oracle/mfggptcdb/10.2.0/admin/mfggptc_webisstg70/bdump/alert_mfggptc.log: cannot create

^J is cause of error.

I tried below command but its not recycling log file.

echo \> ${DATABASE_PARAM_PATH}/${file_name}

Any help is greatly appreciated.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

which not working as expected

Hello. Consider the following magic words: # ls `which adduser` ls: /usr/sbin/adduser: No such file or directory # Hmmm... Then: # ls /usr/sbin/adduser /usr/sbin/adduser # Now what? Unforunately this little sniippet is used in my debian woody server's mysql pre install script.... (2 Replies)
Discussion started by: osee
2 Replies

2. Shell Programming and Scripting

ls not working as expected within ksh

Hi, I use the command ls a\b\c\*.txt from the command line on HP UNIX and it works fine - It lists all files matching *.txt in the a\b\c directory When embeded in a ksh script `ls a\b\c\*.txt` it does not work - I get *.txt not found (even though there are files) I tried... (10 Replies)
Discussion started by: GNMIKE
10 Replies

3. Shell Programming and Scripting

Why this is not working in expected way?

total=0 seq 1 5 | while read i ; do total=$(($total+$i)) echo $total done echo $totalThis outputs: 1 3 6 10 15 0whereas I am expecting: 1 3 6 10 15 15My bash version: (4 Replies)
Discussion started by: meharo
4 Replies

4. UNIX for Dummies Questions & Answers

-atime not working as expected

I need to sort through a volume that contains video files by access time and delete files that have not been accessed over x days. I have to use the access time as video files are originals that do not get modified, just read Testing commands on a local test folder... $ date Wed Sep 28... (10 Replies)
Discussion started by: canon273
10 Replies

5. Shell Programming and Scripting

echo is not working as expected

for i in `cat /export/home/afahmed/Arrvial_time.txt` do echo $i echo $i | awk '$3 < $D { print $4 }' >> dynamic_DF.txt; done When i echo, its echo as Nov 15 02:24 /export/home/pp_adm/inbound//wwallet_20111115.txt where i expect it to be Nov 15 02:24... (7 Replies)
Discussion started by: afahmed
7 Replies

6. Shell Programming and Scripting

stderr redirection not working

I am running tcsh/csh shell on my machine. lately i have realized my stderr file redirection is not working. Please find the terminal logs as below: >echo b c >>& log >cat log b c >echo $a b c >>& log a: Undefined variable. >cat log b c I have never faced such issues, hence not sure... (5 Replies)
Discussion started by: animesharma
5 Replies

7. UNIX for Dummies Questions & Answers

Nohup not working as expected

Hi. I am trying to start a script on my router that will execute even if i log off. To execute the script I write: nohup ./dslconnection > dslstat.out 2>&1 & It starts the job: 21968 admin 1604 S /bin/ash ./dslconnection The problem is that when I log back in the job has been... (6 Replies)
Discussion started by: sebcou
6 Replies

8. Shell Programming and Scripting

Script not working as expected

Hi, I have prepared a script and trying to execute it but not getting expected output. Could you please help and advise what is going wrong. "If else" part in below script is not working basically. I am running it on HP-UX. for i in slpd puma sfmdb do echo "******\t$i\t*******" echo... (10 Replies)
Discussion started by: sv0081493
10 Replies

9. UNIX for Advanced & Expert Users

Test -e not working as expected (by me)

I ran into the following and still do not understand entirely the rationale behind this. If someone could explain why things are as they are I'd be thankful. The following was tested on AIX 7.1 with ksh88, but i suspect that to be ubiquitous. In an installation routine i had to create a set of... (6 Replies)
Discussion started by: bakunin
6 Replies

10. Shell Programming and Scripting

Cp command not working as expected in HPUX

Hi, I'm having trouble with a simple copy command in a script on HPUX. I am trying to copy a file and append date & time. The echo command prints out what I am expecting.. echo "Backing up $file to $file.$DATE.$FIXNUM" | tee -a $LOGFILE + echo 'Backing up... (4 Replies)
Discussion started by: Glennyp
4 Replies
CUBRID_NEW_GLO(3)							 1							 CUBRID_NEW_GLO(3)

cubrid_new_glo - Create a glo instance

SYNOPSIS
string cubrid_new_glo (resource $conn_identifier, string $class_name, string $file_name) DESCRIPTION
The cubrid_new_glo(3) function is used to create a glo instance in the requested class (glo class). The glo created is a LO type, and is stored in the $file_name file. PARAMETERS
o $conn_identifier -Connection identifier. o $class_name -Name of the class that you want to create a glo in. o $file_name -The file name that you want to save in the newly created glo. RETURN VALUES
Oid of the instance created, when process is successful. FALSE, when process is unsuccessful. EXAMPLES
Example #1 cubrid_new_glo(3) example <?php $oid = cubrid_new_glo ($con, "glo", "input.jpg"); if ($oid){ // the type of column "image" is "object" $req = cubrid_execute ($con, "insert into person(image) values($oid)"); if ($req) { echo "image inserted successfully"; cubrid_close_request ($req); cubrid_commit($con); } } ?> NOTES
Note For backward compatibility, the following deprecated alias may be used: cubrid_new_glo(3) Note This function is removed from CUBRID 3.1. SEE ALSO
cubrid_save_to_glo(3), cubrid_load_from_glo(3), cubrid_send_glo(3). PHP Documentation Group CUBRID_NEW_GLO(3)
All times are GMT -4. The time now is 07:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy