10-01-2010
No, there seems nothing to be wrong with the counter.
I use to count until <2 because it switches the array elements of the file1, file2 and file3 vars.
I use this array to pair the special text with the filename that belongs to the special text.
Maybe there's a completely different way to solve this?
Or I'm just not seeing the wood for the trees!
JohnDoe
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'm trying to code a simple script (c-shell) on a Solaris box and I'm getting an "Ambiguous" error. These are the lines that cause the error:
On c-shell:
> set var = ""
> @ var = `ls -l`
`ls -l`: Ambiguous
However if I change the second line to:
> set var = `ls -l`
This works... (2 Replies)
Discussion started by: Guillermo Lopez
2 Replies
3. Shell Programming and Scripting
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.... (6 Replies)
Discussion started by: pareshan
6 Replies
4. 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
5. 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
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
LEARN ABOUT DEBIAN
refcount_init
REFCOUNT(9) BSD Kernel Developer's Manual REFCOUNT(9)
NAME
refcount, refcount_init, refcount_acquire, refcount_release -- manage a simple reference counter
SYNOPSIS
#include <sys/param.h>
#include <sys/refcount.h>
void
refcount_init(volatile u_int *count, u_int value);
void
refcount_acquire(volatile u_int *count);
int
refcount_release(volatile u_int *count);
DESCRIPTION
The refcount functions provide an API to manage a simple reference counter. The caller provides the storage for the counter in an unsigned
integer. A pointer to this integer is passed via count. Usually the counter is used to manage the lifetime of an object and is stored as a
member of the object.
The refcount_init() function is used to set the initial value of the counter to value. It is normally used when creating a reference-counted
object.
The refcount_acquire() function is used to acquire a new reference. The caller is responsible for ensuring that it holds a valid reference
while obtaining a new reference. For example, if an object is stored on a list and the list holds a reference on the object, then holding a
lock that protects the list provides sufficient protection for acquiring a new reference.
The refcount_release() function is used to release an existing reference. The function returns a non-zero value if the reference being
released was the last reference; otherwise, it returns zero.
Note that these routines do not provide any inter-CPU synchronization, data protection, or memory ordering guarantees except for managing the
counter. The caller is responsible for any additional synchronization needed by consumers of any containing objects. In addition, the call-
er is also responsible for managing the life cycle of any containing objects including explicitly releasing any resources when the last ref-
erence is released.
RETURN VALUES
The refcount_release function returns non-zero when releasing the last reference and zero when releasing any other reference.
HISTORY
These functions were introduced in FreeBSD 6.0.
BSD
January 20, 2009 BSD