How is it possible under UNIX to restrain the number of digits of the PID number?
For instance, we have a product that generates a PID of 7 digits, and we would like to have only 6 digits maximum instead for the PID.
Thank you for your help. (1 Reply)
Hi all
Can anybody suggest me, how to get the count of digits in a word
I tried
WORD=abcd1234
echo $WORD | grep -oE ] | wc -l
4
It works in bash command line, but not in scripts :mad: (12 Replies)
Hi all,
there is a data in a file wich loks likes
00:00:49|24.48|
00:01:49|22.83|
00:02:49|22.07|
00:03:49|20.72|
00:04:49|21.28|
00:05:49|21.22|
00:06:49|21.38|
00:07:49|20.93|
00:08:49|21.27|
00:09:49|20.65|
00:10:49|19.42|
00:11:49|21.93|
00:12:49|20.62|
00:13:49|20.23|... (3 Replies)
Hi everyone,
I am new here and generally not experienced with linux. My question must be easy, but as for now I have no idea how to do it.
I have lots of directories with numerical names, e.g. 50 50.1 50.12 etc. What I want is to leave directories with no or single digit after the decimal... (2 Replies)
please help me write a perl program to find the difference of 1 and zeros of a 6 digit binary number.
eg If input is 111100 expected output +2
if input is 000011 expected output -2
input is 000111 expected output 0 (2 Replies)
HI all,
I have output of something like this:
crab: ExitCodes Summary
>>>>>>>>> 12 Jobs with Wrapper Exit Code : 50117
List of jobs: 1-12
See https:///twiki/something/ for Exit Code meaning
crab: ExitCodes Summary
>>>>>>>>> 5 Jobs with Wrapper Exit Code : 8001
List of... (20 Replies)
I have input file like below,
201424|9999|OSS|622010|RGT|00378228764
201424|8888|OM|587079|RGT|00284329675
201424|7777|OM|587076|RGT|00128671024
201424|6666|OM|581528|RGT|00113552084
Output should be like below, should add decimal (.) from last 4 digits.
... (2 Replies)
Discussion started by: vinothsekark
2 Replies
LEARN ABOUT PHP
basename
BASENAME(3) 1 BASENAME(3)basename - Returns trailing name component of pathSYNOPSIS
string basename (string $path, [string $suffix])
DESCRIPTION
Given a string containing the path to a file or directory, this function will return the trailing name component.
PARAMETERS
o $path
- A path. On Windows, both slash ( /) and backslash ( ) are used as directory separator character. In other environments, it is
the forward slash ( /).
o $suffix
- If the name component ends in $suffix this will also be cut off.
RETURN VALUES
Returns the base name of the given $path.
EXAMPLES
Example #1
basename(3) example
<?php
echo "1) ".basename("/etc/sudoers.d", ".d").PHP_EOL;
echo "2) ".basename("/etc/sudoers.d").PHP_EOL;
echo "3) ".basename("/etc/passwd").PHP_EOL;
echo "4) ".basename("/etc/").PHP_EOL;
echo "5) ".basename(".").PHP_EOL;
echo "6) ".basename("/");
?>
The above example will output:
1) sudoers
2) sudoers.d
3) passwd
4) etc
5) .
6)
NOTES
Note
basename(3) operates naively on the input string, and is not aware of the actual filesystem, or path components such as " ..".
Note
basename(3) is locale aware, so for it to see the correct basename with multibyte character paths, the matching locale must be set
using the setlocale(3) function.
SEE ALSO dirname(3), pathinfo(3).
PHP Documentation Group BASENAME(3)