10-26-2010
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
root:x:0:0:0000-Admin(0000):/:/sbin/sh
rootcsh:x:0:1:0000-Admin(0000):/:/bin/csh
nocol:x:6312:630:NOCOL Monitor,,,:/usr/local/lib/nocol-client:/usr/local/bin/bash
nobody:x:60001:60001:uid no body:/:/usr/local/bin/bash
noaccess:x:60002:60002:uid no access:/:/usr/local/bin/bash... (2 Replies)
Discussion started by: sonicstage
2 Replies
2. Shell Programming and Scripting
Sed with sort doesnt work
The below code doesnt work:
sed -e '/^$/d' -e 's/,/|/g' | sort -t"|" -k1,1 -u file1
when i seperate them it work but i have to create intermediate file which i dont want to:
sed -e '/^$/d' -e 's/,/|/g' file1 > file2
sort -t"|" -k1,1 -u file2
Help... (2 Replies)
Discussion started by: pinnacle
2 Replies
3. Shell Programming and Scripting
Hi,everyone:
I'm new to shell, and now get trouble with some script:
line=`/usr/xpg4/bin/awk '/^(*\|){2}'"$CR"'/ {print $0}' ${TIER4FILE}|grep -v
OSNAME=`sed -n ''$LINE'p' $DATALOC/os`
sort +1 /tmp/LhasaCRs2 > /tmp/LhasaCRs1
I cannot understand the "{2}" here. My mentor said it... (1 Reply)
Discussion started by: mycoy
1 Replies
4. Shell Programming and Scripting
Hi everyone!
I have a file like that:
And I would it like that:
I don't know how to keep the first field and sort the second one.
I have a second question with sed...
to put the variable $VAR at the beginning of the file...
But I have an output like this:
snork... (3 Replies)
Discussion started by: Castelior
3 Replies
5. Shell Programming and Scripting
I have a file and need to only select users that have a shell of “/bin/bash” in the line using awk or sed please help (4 Replies)
Discussion started by: boyboy1212
4 Replies
6. Shell Programming and Scripting
Hi,
INPUT:
DCBADD
OUTPUT:
ABCD
The SED script should alphabetically sort the chars in the string and remove the duplicate chars. (5 Replies)
Discussion started by: jds93
5 Replies
7. Shell Programming and Scripting
input file
abc1
abc23
abc12
abc15
output
abc1
abc12
abc15
abc23 (9 Replies)
Discussion started by: yanglei_fage
9 Replies
8. Shell Programming and Scripting
Hi All, Need Suggestion, Want to sort a file using awk & sed to get required, output as below, such that each LUN shows correct WWPN and FA port Numbers correctly:
Required output:
01FB 10000000c97843a2 8C 0
01FB 10000000c96fb279 9C 0
22AF 10000000c97843a2 8C 0
22AF 10000000c975adbd ... (10 Replies)
Discussion started by: aix_admin_007
10 Replies
9. Shell Programming and Scripting
Hi,
i "tried" to sort data by date. So far, i used sed to take the data from the last and the actual month. Now, after changing the year it is not working properly.
i use:
GNU bash, version 4.2.45(1)-release (x86_64-suse-linux-gnu)
sed -n '/\//p' $Home/../scripte/pd_0.txt
y is a... (6 Replies)
Discussion started by: IMPe
6 Replies
10. UNIX for Beginners Questions & Answers
Hi, I need to join these statements for efficiency, and without having to make a new directory for each batch. I'm annotating commands below.
wget -q -r -l1 URL
^^ can't use -O - here and pipe | to grep because of -r
grep -hrio "\b\+@\+\.\{2,4\}\+\b" * > first.txt
^^ Need to grep the output... (14 Replies)
Discussion started by: p1ne
14 Replies
LEARN ABOUT PHP
pg_result_seek
PG_RESULT_SEEK(3) PG_RESULT_SEEK(3)
pg_result_seek - Set internal row offset in result resource
SYNOPSIS
bool pg_result_seek (resource $result, int $offset)
DESCRIPTION
pg_result_seek(3) sets the internal row offset in a result resource.
PARAMETERS
o $result
- PostgreSQL query result resource, returned by pg_query(3), pg_query_params(3) or pg_execute(3) (among others).
o $offset
- Row to move the internal offset to in the $result resource. Rows are numbered starting from zero.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
pg_result_seek(3) example
<?php
// Connect to the database
$conn = pg_pconnect("dbname=publisher");
// Execute a query
$result = pg_query($conn, "SELECT author, email FROM authors");
// Seek to the 3rd row (assuming there are 3 rows)
pg_result_seek($result, 2);
// Fetch the 3rd row
$row = pg_fetch_row($result);
?>
SEE ALSO
pg_fetch_row(3), pg_fetch_assoc(3), pg_fetch_array(3), pg_fetch_object(3), pg_fetch_result(3).
PHP Documentation Group PG_RESULT_SEEK(3)