Hi guys!
I have just started with shell programming!!
I am having pronblem with variable subsitutuion.
when i do
egrep "*" marks
this will give me the pattern match.
but how can i catch the output of that result in a variable.
if i say
result = egrep "*" marks
it gives me syntax... (2 Replies)
Hi Guys,
I am trying to alter a script for my company.
I need the start of it to go something like this.
User is asked to input 8 numbers
8 numbers are written to a txt file
***** ***** ***** txt file is read ***** *****
The text file gets read in between other files represented by... (2 Replies)
Hi all,
i am beginner to unix and trying out a shell script which does the following. i have to calculate a persons salary. his salary is read from the keyboard. he has two types of deductions. 40% as dearness allowance and 20% as house rent. i have to print the gross salary. here is the code... (5 Replies)
I need to invoke a program on remote server using ssh in a shell script. In addition i would like to capture date/time and if there is any errors , then script should write to log file. can someone please help me out? (1 Reply)
Hi,
I have a file in which records contains non ascii characters. The records are comma delimited and quoted.
The non ascii characters are found in a particular column.
Example records
"YY","AK000021","Ã","IO","PP"
"Y1","AK000022","Ã","PO","PP"
"Y2","AK000022","Ã","PO","PP"
I need to... (2 Replies)
hi guys
we've had nagios spewing false alarm (for the umpteenth time) and finally the customer had enough so they're starting to question nagios. we had the check interval increased from 5 minutes to 2 minutes, but that's just temporary solution. I'm thinking of implementing a script on the... (8 Replies)
I need to create digit day script that takes a single numeric argument and then it should print out the day of the week using the number modulo 7 formula e.g: 0 - Sunday 6- Saturday 131 - Friday
I am fairly new to unix so I don't know how to use the number modulo 7 formula.
Does the script need... (3 Replies)
Hi All,
I have a script which as below
#!/bin/bash
for i in `cat servers`
do
ssh uname@$i "df -t xfs --total | grep total";
done > out.txtOutput as below
--------------
total 140583991104 118622795524 21961195580 85% -
total 140583991104 112888595524 27695395580 ... (4 Replies)
So I'm trying to pass certain json elements as env vars and use them later on in a script.
Sample json:
JSON='{
"Element1": "file-123456",
"Element2": "Name, of, company written in, a very weird way",
"Element3": "path/to/some/file.txt",
}'
(part of the) script:
for s... (5 Replies)
In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed ? Is there any way to get the script names for the process command ?
--- Post updated at 08:39 AM ---
in KSH (Korn Shell), my command output shows the script names but when run in the Bash Shell... (3 Replies)
Discussion started by: i4ismail
3 Replies
LEARN ABOUT PHP
mssql_field_seek
MSSQL_FIELD_SEEK(3)MSSQL_FIELD_SEEK(3)mssql_field_seek - Seeks to the specified field offsetSYNOPSIS
bool mssql_field_seek (resource $result, int $field_offset)
DESCRIPTION
Seeks to the specified field offset. If the next call to mssql_fetch_field(3) won't include a field offset, this field would be returned.
PARAMETERS
o $result
- The result resource that is being evaluated. This result comes from a call to mssql_query(3).
o $field_offset
- The field offset, starts at 0.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Using mssql_field_seek(3) on the example for mssql_fetch_field(3)
<?php
// Connect to MSSQL and select the database
mssql_connect('MANGOSQLEXPRESS', 'sa', 'phpfi');
mssql_select_db('php');
// Send a select query to MSSQL
$query = mssql_query('SELECT * FROM [php].[dbo].[persons]');
// Construct table
echo '<h3>Table structure for 'persons'</h3>';
echo '<table border="1">';
// Table header
echo '<thead>';
echo '<tr>';
echo '<td>Field name</td>';
echo '<td>Data type</td>';
echo '<td>Max length</td>';
echo '</tr>';
echo '</thead>';
// Dump all fields
echo '<tbody>';
for ($i = 0; $i < mssql_num_fields($query); ++$i) {
// Fetch the field information, notice the
// field_offset parameter is not set. See
// the mssql_field_seek call below
$field = mssql_fetch_field($query);
// Print the row
echo '<tr>';
echo '<td>' . $field->name . '</td>';
echo '<td>' . strtoupper($field->type) . '</td>';
echo '<td>' . $field->max_length . '</td>';
echo '</tr>';
// Move the internal seek pointer to the next
// row in the result set
mssql_field_seek($query, $i + 1);
}
echo '</tbody>';
echo '</table>';
// Free the query result
mssql_free_result($query);
?>
SEE ALSO mssql_fetch_field(3).
PHP Documentation Group MSSQL_FIELD_SEEK(3)