I'm new to unix scripting. How would I go about pulling the first 3 characters from a variable in ksh and storing in another variable? Thanks. (9 Replies)
Hey all,
I have been using Ksh and in that I am setting Environment variables.
To set Env. Variables I have created my own file "BuildScript.sh" in which i have written :
export CLASSPATH=/somedir/some other dir/file:.
export PATH=/some dir/file:.
But when i am calling this... (4 Replies)
hi all,
how do i subract variables in shell ?? am trying to space out the headers and the output generated by the shell so they all line up :
currently the output is like this :
servers : users
server1 : 10
latestServer : 50
so i thought... (3 Replies)
I'm trying to set a variable to the output of a command.
This is what the comand output to the display looks like:
/>hciconndump -v TOsiu
Dump of connection(s): TOsiu
----------------------------------------------------------------------
Process: A60Tsiu Connection: TOsiu... (2 Replies)
Hello,
I have a problem combining two variables into one.
I did the following:
in my env variables i had set
PATH_DESTINATION_1=/root/path_one
PATH_DESTINATION_2=/root/path_two
#!/usr/bin/ksh
count=1
count_path=2
while
do (3 Replies)
Hi,
I 'm trying to send an e-mail for every different line in the .txt
for i in {1..$variable}
do
sed -n "/$i$/p" text.txt
done
I have two problems about this.
First one is that for loop doesn't work
and the second one is that i cant get the output of sed (4 Replies)
Hello, I am a new joiner to the forum, and have what i hope is a simple question, however I can't seem to find the answer so maybe it is not available within bash scripting.
I intend to use the below script to archive files from multiple directories at once by using a loop, and a variable (n)... (10 Replies)
Cannot combine these two strings into one line, either as a 3rd variable or echo or printing ? Frustrating.
for i in `cat /scripts/pathList.dat`
do
OldRepo= grep Oldhostname ${i}/.svn/entries | tail -1
NewRepo= grep Oldhostname ${i}/.svn/entries | tail -1 | sed '/Oldhostname/... (41 Replies)
Hi Friends ,
I want to know how to format the output for the following:
i searched in the forum and couldnt get the exact requirement.
Thanks in advance . (2 Replies)
Here is the whole script, very simple, but I am just learning
ROK_NO=$1
RPT=/tmp/test
sed -E '/^SELECT/ s/(.{23}).{8}/\1'"$ROK_NO"' /' $RPT
echo $RPT
When I run this I get
$ bash rok.sh 2388085
: No such file or directory
/tmp/test
When I type the command in console, it works... (3 Replies)
Discussion started by: isey78
3 Replies
LEARN ABOUT PHP
mssql_fetch_field
MSSQL_FETCH_FIELD(3)MSSQL_FETCH_FIELD(3)mssql_fetch_field - Get field informationSYNOPSIS
object mssql_fetch_field (resource $result, [int $field_offset = -1])
DESCRIPTION mssql_fetch_field(3) can be used in order to obtain information about fields in a certain query result.
PARAMETERS
o $result
- The result resource that is being evaluated. This result comes from a call to mssql_query(3).
o $field_offset
- The numerical field offset. If the field offset is not specified, the next field that was not yet retrieved by this function is
retrieved. The $field_offset starts at 0.
RETURN VALUES
Returns an object containing field information.
The properties of the object are:
o name - column name. if the column is a result of a function, this property is set to computed#N, where #N is a serial number.
o column_source - the table from which the column was taken
o max_length - maximum length of the column
o numeric - 1 if the column is numeric
o type - the column type.
EXAMPLES
Example #1
mssql_fetch_field(3) example
<?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
$field = mssql_fetch_field($query, $i);
// Print the row
echo '<tr>';
echo '<td>' . $field->name . '</td>';
echo '<td>' . strtoupper($field->type) . '</td>';
echo '<td>' . $field->max_length . '</td>';
echo '</tr>';
}
echo '</tbody>';
echo '</table>';
// Free the query result
mssql_free_result($query);
?>
SEE ALSO mssql_field_seek(3).
PHP Documentation Group MSSQL_FETCH_FIELD(3)