Maybe you should directly construct the array like this:
Code:
# to add $FILE (string) to $FILES (array)
$FILES[${#FILES[@]}]="$FILE" # ${#FILES[@]} gives the nb of elements in the array => the first empty index (first is 0)
Hello Everybody,
Does anyone know what the @ symbol means in a csh script, if used with a variable assignment as below
@ line = 1
why not just use....
set line=1
Many thanks
rkap (1 Reply)
Im facing problem in assigning value of eval array variable as normal variable..
x=0
eval DATA${x}="FJSVcpcu"
x=`expr $x + 1`
eval DATA${x}="FJSVcsr"
if x=0, type -> eval echo \$DATA$x , its give me FJSVcpcu
i want assign this value into an variable as
variable=`eval echo... (3 Replies)
Hello,
I have a script that does an scp to a server and then gets the number of process running on that server, the o/P should be stored in a variable for further processing
eval `echo "ssh -q $Infa_user@$host 'csh -c $CMD '"`
where
CMD="ps -ef | grep -i ${INFA_REPO} | grep -v grep | wc... (2 Replies)
Hi Gurus,
I am having 2 parameters as below
parm1=value1
parm2=parm1
I want to evaluate parm1 value using eval echo \$$parm2 and later i want to assign this value to other variable which i will be using in if statement like :
if ]; then
do this.......
fi
could you please suggest... (5 Replies)
pattern1=book
{
x=1
eval echo \$pattern$x
}
book (this is the output)
But when I assign a variable to the output of the eval it doesn't work unless I prefix 2 times backslash before $ as shown below.
{
a=`eval echo \\$pattern$x`
echo $a
}
book
Why here twice "\" has to be... (3 Replies)
Is there a safe way to evaluate variable declarations within a script whether they come from a .conf file, user input, or stdin?
Example .conf file:
server=ftp.xxxx.com
port=21
user="$USER" # Hopefully allow this type of substitution
domain="$DOMAIN"
server="$(malicious... (4 Replies)
Hi
I have a strange problem:
In my shell script I am performing a copy task:
. prop.txt
cp -r $dir/ $dir/archive
$dir is fetched from a property file (prop.txt) which stores its value
dir=/opt/data
Now the problem is another dir1 comes into picture. I only want to add... (1 Reply)
Hi
I am facing a problem.
export local_folder=/opt/app/
cd /opt/app/abc/
abcversion="abc*" (abcga5 is inside /opt/app/abc/)
echo $abcversion (it echoes the correct version as abcga5 )
Now when I reuse the value of abcversion for a below path:
export... (6 Replies)
Discussion started by: ankur328
6 Replies
LEARN ABOUT DEBIAN
xfseek
FILES(3pub) C Programmer's Manual FILES(3pub)NAME
xgetaline, xfseek, xfopen, xfclose, getaline, fassert - file manipulation utilities
SYNOPSIS
#include <files.h>
FILE *xfopen(const char *filename, const char *mode);
void xfclose(FILE *fp);
void xfseek(FILE *fp, long offset, int origin);
char *getaline(FILE *fp);
char *xgetaline(FILE *fp);
void fassert(FILE *fp);
DESCRIPTION
These functions are useful for file manipulation. The functions that begin with x work like the functions without the letter, except if
there is an error, they print an error message and kill the program.
getaline reads a line from the given file. It allocates the memory for the line with malloc(3), and returns a pointer to the beginning of
the line. If there is an error, it returns NULL. If the returned value is not NULL, the caller is responsible for freeing the memory.
The newline is removed from the end of the line.
fassert checks that the argument is not NULL, and that (for a non-NULL argument) the file does not have its error indicator flag set. If
either condition is true, it prints an error message and termiantes the program. If neither condition is true, it does nothing. This can
be used to add checks that the I/O in a program is going well; however, it is mostly useful only for small programs, because more serious
programs need to handle the errors more gracefully.
SEE ALSO publib(3)AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi)
Publib C Programmer's Manual FILES(3pub)