.sh is not a shell. .sh is a common filename extension used on Windows systems to indicate that the contents of the file are a shell script. But, since you're using Red Hat Linux instead of Windows, we don't know if you're using bash (or sh that is often a link to bash with several built-in utilities and syntax features that behave differently), dash, ksh, zsh, or one of several other shells that might or might not be available on your system.
Quote:
What logic is used to determine that one test is dependent on another test?
Showing us code that does not produce the output you want does not explain the logic that is supposed to be used to determine what things are dependent on other things in your desired output.
Please explain, in English, the logic that you want to use to determine dependencies.
hello
have a file1
H87I
Y788O
T347U
J23U
and
file2 J23U U887Y I99U T556U
file3 I99O J99T F557J
file4 N99I T666U R55Y
file5 H87I T347U
file6 H77U R556Y E44T
file7 Y788O K98U H8I
May be using script we can use file1 to search for all the files
and have the output
H87I file5... (3 Replies)
Hi guys,
firstly I'm working on SunOS 5.10 Generic_125100-10 sun4u sparc SUNW,Sun-Fire-V240
I've made a script to compress two directory and then send them to an other server via ftp. This is working very well.
Inside theis script I decide to log usefull data for troubleshooting in case of... (7 Replies)
Give shell script....which takes two file names as input and compares the contents, is both are same delete second file's contents.....
I try with "diff"...... but confusion how to use "diff" with if ---else
Thanking you (5 Replies)
Hello
Has anyone got an example shell script that I can use to compare the contents of two files.
The files should contain the same contents, eg.
file1.txt
apple
pear
grape
file2.txt
apple
pear
grape (2 Replies)
All,
PLease can you help me with a shell script which can compare two xml files and print the difference to a output file.
I have attached one such file for you reference.
<Group>
<Member ID=":Year_Quad:41501" childCount="4" fullPath="PEPSICO Year-Quad-Wk : FOLDER.52 Weeks Ending Dec... (2 Replies)
Hi All,
Need help on this
I have 2 files
one file file1 which has several entries as :
define service{
hostgroup_name !host1,!host5,!host6,.*
service_description check_nrpe
}
define service{
hostgroup_name !host2,!host4,!host6,.*
service_description check_opt
}
another... (2 Replies)
Hi Friends,
I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving...
File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
So I'm stumped.
First... APOLOGIES... my work is offline in an office that has zero internet connectivity, as required by our client. If need be, I could print out my script attempts and retype them here. But on the off chance... here goes.
I have a text file (file_source) of terms, each line... (3 Replies)
I am trying to consolidate multiple information files (<hostname>.Linux.nfslist) into one file so that I can import it into Excel. I can get the file contents with cat *Linux.nfslist >> nfslist.txt. I need each line prefaced with the hostname. I am unsure how to do this.
--- Post updated at... (5 Replies)
Like to have shell script to Read the given file contents into a merged one file with header of path+file name followed by file contents into a single output file.
While reading and merging the file contents into a single file, Like to keep the format of the source file.
... (4 Replies)
Discussion started by: Siva SQL
4 Replies
LEARN ABOUT PHP
php_uname
PHP_UNAME(3) 1 PHP_UNAME(3)php_uname - Returns information about the operating system PHP is running onSYNOPSIS
string php_uname ([string $mode = "a"])
DESCRIPTION php_uname(3) returns a description of the operating system PHP is running on. This is the same string you see at the very top of the
phpinfo(3) output. For the name of just the operating system, consider using the PHP_OS constant, but keep in mind this constant will con-
tain the operating system PHP was built on.
On some older UNIX platforms, it may not be able to determine the current OS information in which case it will revert to displaying the OS
PHP was built on. This will only happen if your uname() library call either doesn't exist or doesn't work.
PARAMETERS
o $mode
-$mode is a single character that defines what information is returned:
o 'a': This is the default. Contains all modes in the sequence "s n r v m".
o 's': Operating system name. eg. FreeBSD.
o 'n': Host name. eg. localhost.example.com.
o 'r': Release name. eg. 5.1.2-RELEASE.
o 'v': Version information. Varies a lot between operating systems.
o 'm': Machine type. eg. i386.
RETURN VALUES
Returns the description, as a string.
EXAMPLES
Example #1
Some php_uname(3) examples
<?php
echo php_uname();
echo PHP_OS;
/* Some possible outputs:
Linux localhost 2.4.21-0.13mdk #1 Fri Mar 14 15:08:06 EST 2003 i686
Linux
FreeBSD localhost 3.2-RELEASE #15: Mon Dec 17 08:46:02 GMT 2001
FreeBSD
Windows NT XN1 5.1 build 2600
WINNT
*/
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
echo 'This is a server using Windows!';
} else {
echo 'This is a server not using Windows!';
}
?>
There are also some related Predefined PHP constants that may come in handy, for example:
Example #2
A few OS related constant examples
<?php
// *nix
echo DIRECTORY_SEPARATOR; // /
echo PHP_SHLIB_SUFFIX; // so
echo PATH_SEPARATOR; // :
// Win*
echo DIRECTORY_SEPARATOR; //
echo PHP_SHLIB_SUFFIX; // dll
echo PATH_SEPARATOR; // ;
?>
SEE ALSO phpversion(3), php_sapi_name(3), phpinfo(3).
PHP Documentation Group PHP_UNAME(3)