i am not able to understand the following code for awk:
$awk -F"|" '{ kount++}
>END { for (desig in kount)
> print desig,kount }' emp.list
the input file i.e. emp.list is ::
3432| p.k.agrwal |g.m |sales
4566|g.l.sharma |director|production
3433|r shah | g.m | production... (1 Reply)
Hi all,
#!/usr/dt/bin/dtksh
typeset -A wavelength
wavelength=650
wavelength=590
wavelength=510
wavelength=475
wavelength=445
wavelength=400
I have created an associative array like the one above.
Now I am trying to print the values
If i give print ${wavelength} it is... (4 Replies)
Hello,
i'm writing a little script that checks a .txt file for a specific ID that came after 9:10 am which outputs it's data to a file LateUsers.txt
once done , it should mention the following:
Number of late users
Number of unique late users
Over all late users percentage
number of... (0 Replies)
I m executing ps command and sorting it according to memory usage.
Please find the output of the command.
# ps aux --sort pmem
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 2060 624 ? Ss 01:54 0:00 init
root 2 0.0... (1 Reply)
I have this piece of code. The first if statement is not working, however the second if statement is working fine.
I have set a value for Srcs to be file.srcs and want to print it.
If no value for Rcvs is set, I get the print statement correctly
hasValue="file.srcs"
if ${hasValue}; then
... (0 Replies)
I have the following code, and I am changing it to
#!/bin/bash
hasArgumentCModInfile=0
hasArgumentSrcsInfile=0
hasArgumentRcvsInfile=0
OLDIFS="$IFS"
IFS="|=" # IFS controls splitting. Split on "|" and "=", not whitespace.
set -- $* # Set the positional... (3 Replies)
Hi,
We have a filesystem whose usage has gone above 81%, i tried to zip some files in the sub directories but the space is not released in the main file system.
> df -h
Filesystem size used avail capacity Mounted on
/u01/app 5.8G 4.6G 1.2G 81% ... (2 Replies)
Hi
below is the samll awk script which i am not able to understand properly.
here a bit confusion in 2nd line for me
1. why *\ is not used before . in second line as it was used in first line *\$*\. */
2. why always \ is used in every first line
3. is there any specific meaning... (9 Replies)
Hi,
I have the following dataset.
A 2 1 272
A 2 2 333
A 2 3 222
A 3 1 222
A 3 2 11
B 1 1 112
B 1 2 998
B 2 1 667
C 1 1 887
C 1 2 887
C 2 1 998
I need to have an associate array based on the first column and generate a auto generated number column in the last column.
Needed output:... (2 Replies)
Discussion started by: mitt
2 Replies
LEARN ABOUT PHP
stream_context_create
STREAM_CONTEXT_CREATE(3) 1 STREAM_CONTEXT_CREATE(3)stream_context_create - Creates a stream contextSYNOPSIS
resource stream_context_create ([array $options], [array $params])
DESCRIPTION
Creates and returns a stream context with any options supplied in $options preset.
PARAMETERS
o $options
- Must be an associative array of associative arrays in the format $arr['wrapper']['option'] = $value. Default to an empty array.
o $params
- Must be an associative array in the format $arr['parameter'] = $value. Refer to context parameters for a listing of standard
stream parameters.
RETURN VALUES
A stream context resource.
CHANGELOG
+--------+---------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------+
| 5.3.0 | |
| | |
| | Added the optional $params argument. |
| | |
+--------+---------------------------------------+
EXAMPLES
Example #1
Using stream_context_create(3)
<?php
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-language: en
" .
"Cookie: foo=bar
"
)
);
$context = stream_context_create($opts);
/* Sends an http request to www.example.com
with additional headers shown above */
$fp = fopen('http://www.example.com', 'r', false, $context);
fpassthru($fp);
fclose($fp);
?>
SEE ALSO stream_context_set_option(3), Listing of supported wrappers ("Supported Protocols and Wrappers"), Context options ("Context options and
parameters").
PHP Documentation Group STREAM_CONTEXT_CREATE(3)