It seems like this command iterates each time on a different row so $1 is the first field of each row.. But what caused it to refer to each row ?.
What I mean is, how it knows that for the second iteration for example, $1 should be the first field of the second row rather then the first field of the first row again ?
Last edited by Don Cragun; 04-04-2018 at 04:13 PM..
Reason: Add missing CODE tags.
Hi All,
I probably miss something fundamental here.
I want to rename a bunch of files in subdirectories (that might contain white spaces) with names that are related.
I thought following could do the job:
find . -name *.sh -exec mv {} $(echo {} | sed -e 's/0/1/g') \;
Now to be able to... (5 Replies)
I was wondering if it was possible to tell awk to print the output of a command in the print.
.... | awk '{print $0}'
I would like it to print the date right before $0, so something like (this doesn't work though)
.... | awk '{print date $0}' (4 Replies)
I am in the process of writing a script to change the grub password in the grub.conf file. I thought I had it figured out, but am running into an a problem I can't put my finger on.
Command I am running when I find that the grub.conf file contains "password --md5".
sed... (1 Reply)
Hi all,
after hours of playing around with this and scouring the web I decided to ask my fellow UNIX operators as I can't wrap my head around this.
First off,
I want to parse an input file with tabs (I could pull this off easily with different delimiters) but I was trying to make nicer... (2 Replies)
I hv a file --am executing a script which is giving me unexpected results
COntents of file:
f1
CMT_AP1_CONT:/opt/sybase/syboc125:150:ASE12_5::Y:UX:
CMT_AP1:/opt/sybase/syboc125:150:ASE12_5::Y:UX
f1.tmp
CMT_AP1_CONT:/opt/sybase/syboc125:150:ASE12_5::Y:UX:... (2 Replies)
Hello,
And when you think you know the basics of something, UNIX in this case, something like what I will describe below comes along....
On a Linux system, a "typical" directory with some files. Say 20.
I do:
> ls | sort > mylisting
Now when I:
> vi mylisting
There is mylisting... (13 Replies)
can anyone help identify where the issue is here?
awk 'BEGIN { c="perl -e 'print scalar(localtime("'${EPOCHTIME}'")), "\n"'"; c|getline; close( c ); print $2" "$3" "$4" "$6; }'
bash: syntax error near unexpected token `('
can't seem to figure it out. i tried this:
awk 'BEGIN {... (5 Replies)
Dear forum members,
I want the script to count ALA as one (an example in quotes) and return an integer as 1 and not return 5 as an integer as it does now (look bash script). So how can I upgrade my script that it first checks or after finding all instances of ALA checks whether it is the same... (25 Replies)
Discussion started by: Aurimas
25 Replies
LEARN ABOUT PHP
msql_result
MSQL_RESULT(3)MSQL_RESULT(3)msql_result - Get result dataSYNOPSIS
string msql_result (resource $result, int $row, [mixed $field])
DESCRIPTION msql_result(3) returns the contents of one cell from a mSQL result set.
When working on large result sets, you should consider using one of the functions that fetch an entire row (specified below). As these
functions return the contents of multiple cells in one function call, they are often much quicker than msql_result(3).
Recommended high-performance alternatives: msql_fetch_row(3), msql_fetch_array(3), and msql_fetch_object(3).
PARAMETERS
o $
result -The result resource that is being evaluated. This result comes from a call to msql_query(3).
o $row
- The row offset.
o $field
- Can be the field's offset, or the field's name, or the field's table dot field's name (tablename.fieldname.). If the column name
has been aliased ('select foo as bar from ...'), use the alias instead of the column name.
Note
Specifying a numeric field offset is much quicker than specifying a fieldname or tablename.fieldname.
RETURN VALUES
Returns the contents of the cell at the row and offset in the specified mSQL result set.
PHP Documentation Group MSQL_RESULT(3)