10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I know the below code worked, but the syntax appears to be wrong and I can not seem to correct it. Thank you :).
awk 'FNR==NR {E; next }>$3 in E {print $3, $5}' medical_exome__genes.txt RefSeqGene.txt > update.txt
awk: cmd. line:1: FNR==NR {E; next }>$3 in E {print $3, $5}
awk: cmd.... (2 Replies)
Discussion started by: cmccabe
2 Replies
2. Shell Programming and Scripting
Could somebody gently point out the error of my ways in the below (the flu I'm fighting might be contributing to my current haplessness)
awk -F="\t" \
'{
for (i = 1; i <= NR; i++);
FNR == i;
{
if (length($3) < 56 && length($1) > 56)
$1=($1" "$2); $2=$3; $3=$4;
... (1 Reply)
Discussion started by: Andrew767
1 Replies
3. Shell Programming and Scripting
Can anyone work out why this line has a syntax error?
awk '{if ($1==1) print NR,$0 } '${PROJECT}/${data_dir}/${ofolder}/STDEV/otimes_${per}_secs.dat > tmp2.txt
I've check that the file exists in the given location (1 Reply)
Discussion started by: claire.a
1 Replies
4. Shell Programming and Scripting
Hi All,
I wrote a simple script.sh program
for i in seq (22)
do awk '$1==${i}' file1.txt|awk '{print $2}'> file${i}_study.txt
done
and then run it
%bash
%chmod +x script.sh
% ./script.sh
Give me error
awk: $1==${i}
awk: ^ syntax error
Do you have any idea why... (3 Replies)
Discussion started by: senayasma
3 Replies
5. Shell Programming and Scripting
Hi, I can't see what is wrong with the following command.
I am extracting a dollar amount (AMT_REJ, 6th field) from a comma delimited record and need to output it as numeric, removing the $sign and decimal point and output to another file. Everything seems to work except the $ sign which I need... (1 Reply)
Discussion started by: ski
1 Replies
6. UNIX for Dummies Questions & Answers
hi there
i write one awk script file in shell programing
the code is related to dd/mm/yy to month, day year format
but i get an error
please can anybody help me out in this problem ??????
i give my code here including error
awk `
# date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies
7. UNIX for Dummies Questions & Answers
Due to some syntax error, my below code is not working.
#!/usr/bin/ksh
nawk '
BEGIN {
cur_val=0; cur_zero=0; cur_nine=0;
sum_zero=0; sum_nine=0;
}
/^/ {
cur_val=substr($0,5,2);
if("cur_val" == "0")
{
... (3 Replies)
Discussion started by: lokiman
3 Replies
8. Shell Programming and Scripting
A shell script a.sh calls an awk script using :
awk -v OUTPUTDIR=${OUTPUTDIR}${OUTPUTDIRDATE} -f ${SCRIPTSPATH}chngNullBillId.awk ${INPUTFILE}
chngNullBillId.awk :
{ if (substr($0,9,4)=="0000") printf( "%s0001%s", substr($0,1,8), substr($0,13,67) )>>${OUTPUTDIR}"goodfile.txt";
else print... (2 Replies)
Discussion started by: Amruta Pitkar
2 Replies
9. Shell Programming and Scripting
mVar=0
count=`awk -F, '( ( $2 ~ /^GIVEUP$/ && $3 ~ /^NEW$/ ) || ( $2 ~ /^SPLIT$/ && $3 ~ /^NEW$/ ) || ( $2 ~ /^OPTION$/ && $3 ~ /^NEW$/ ) || ( $2 ~ /^OPTIONSPLIT$/ && $3 ~ /^NEW$/ ) ) { count++ } END { print count }' myCSV.csv
myVar=`expr $myVar + $count`
Can I do this? I get a syntax... (4 Replies)
Discussion started by: yongho
4 Replies
10. UNIX for Dummies Questions & Answers
can anyone see the awk syntax error near line 1? I keep getting this error and I'm not familiar with awk very well yet so it is hard for me to see the errors.
fyi: deleteuser* refers to files in the directory where each one ends with a different date
ls -1 /mfupload/prod02/ftp/deleteuser* |... (12 Replies)
Discussion started by: k@ssidy
12 Replies
VN_FULLPATH(9) BSD Kernel Developer's Manual VN_FULLPATH(9)
NAME
vn_fullpath -- convert a vnode reference to a full pathname, given a process context
SYNOPSIS
#include <sys/param.h>
#include <sys/vnode.h>
int
vn_fullpath(struct thread *td, struct vnode *vp, char **retbuf, char **freebuf);
DESCRIPTION
The vn_fullpath() function makes a ``best effort'' attempt to generate a string pathname for the passed vnode; the resulting path, if any,
will be relative to the root directory of the process associated with the passed thread pointer. The vn_fullpath() function is implemented
by inspecting the VFS name cache, and attempting to reconstruct a path from the process root to the object.
This process is necessarily unreliable for several reasons: intermediate entries in the path may not be found in the cache; files may have
more than one name (hard links), not all file systems use the name cache (specifically, most synthetic file systems do not); a single name
may be used for more than one file (in the context of file systems covering other file systems); a file may have no name (if deleted but
still open or referenced). However, the resulting string may still be more useable to a user than a vnode pointer value, or a device number
and inode number. Code consuming the results of this function should anticipate (and properly handle) failure.
Its arguments are:
td The thread performing the call; this pointer will be dereferenced to find the process and its file descriptor structure, in order to
identify the root vnode to use.
vp The vnode to search for. No need to be locked by the caller.
retbuf Pointer to a char * that vn_fullpath() may (on success) point at a newly allocated buffer containing the resulting pathname.
freebuf Pointer to a char * that vn_fullpath() may (on success) point at a buffer to be freed, when the caller is done with retbuf.
Typical consumers will declare two character pointers: fullpath and freepath; they will set freepath to NULL, and fullpath to a name to use
in the event that the call to vn_fullpath() fails. After done with the value of fullpath, the caller will check if freepath is non-NULL, and
if so, invoke free(9) with a pool type of M_TEMP.
RETURN VALUES
If the vnode is successfully converted to a pathname, 0 is returned; otherwise, an error number is returned.
SEE ALSO
free(9)
AUTHORS
This manual page was written by Robert Watson <rwatson@FreeBSD.org>.
BSD
November 23, 2008 BSD