Hello,
I am trying to compare two dates which are in variables and i am not getting the correct result as expected.
$first_date = '07/19/2007'
$second_date='07/20/2007'
Can you please suggest how to i check whether they are equal or not.
if ($first_date -eq $second_date) condition is not... (3 Replies)
HI,
I would like to know how to compare two files and replace non-matching lines with "_" .
I can get non-mathing lines with
grep -v -f file1 file2
i just want to knw how to display 'file2' with non-matching lines from 'file1' replaced by "_"
for exmaple
file1:
a
b
c
d
... (2 Replies)
Hi All
I have to files
cat a.txt
AAA
BBB
CCC
DDD
and
cat b.txt
AAA
CCC
EEE
i want to compare these two files and o/p should have content of file a.txt which is not in file b.txt
c.txt
BBB
DDD
Please help me (1 Reply)
Hi All
I have to files
cat a.txt
AAA
BBB
CCC
DDD
and
cat b.txt
AAA
CCC
EEE
i want to compare these two files and o/p should have content of file a.txt which is not in file b.txt
c.txt
BBB
DDD
Please help me (3 Replies)
I have a string like ab or abc of whatever length. But i want to know whether another string ( for example, abcfghijkl, OR a<space> bcfghijkl ab<space> cfghijkl OR a<space>bcfghijkl OR ab<space> c<space> fghijkl ) starts with ab or abc... space might existing on the longer string... If so, i... (1 Reply)
I want to compare two strings using awk dynamically without trimming the spaces and want to find the count of matching string.
Input Strings file:
File1 content (file1):
" a "
" a2 "
File2 content (file2):
" a "
" a "
" a2 "
" b2 "
" c2 "... (3 Replies)
I have two files. one files contain counts and second contain string. Now i have to compare two string . if two string are same i have to add count. If strings are same more than once i have to display final output.
like this
>Count.txt
1
3
12
4
5
6
1
>strings.txt
AA
BB
BB... (1 Reply)
Hi,
I need to know how to compare the permissions of files which are in two different directories in Unix..
Experts - can any one help on this..!!! (1 Reply)
Hi Everyone
I am new to Unix shell scripting
Can anyone please explain me in detail how this command works
awk -F@ 'NR==FNR{A=$2;next}$3 in A{$3=A}1' file2 file1
The above command I got it from this forum, but unable to implement it as I am not getting how this works:mad:
I... (3 Replies)
Discussion started by: Vijay90
3 Replies
LEARN ABOUT SUNOS
setusershell
getusershell(3C) Standard C Library Functions getusershell(3C)NAME
getusershell, setusershell, endusershell - get legal user shells
SYNOPSIS
#include <unistd.h>
char *getusershell(void);
void setusershell(void);
void endusershell(void);
DESCRIPTION
The getusershell() function returns a pointer to a legal user shell as defined by the system manager in the file /etc/shells. If
/etc/shells does not exist, the following locations of the standard system shells are used in its place:
/bin/bash /bin/csh
/bin/jsh /bin/ksh
/bin/pfcsh /bin/pfksh
/bin/pfsh /bin/sh
/bin/tcsh /bin/zsh
/sbin/jsh /sbin/pfsh
/sbin/sh /usr/bin/bash
/usr/bin/csh /usr/bin/jsh
/usr/bin/ksh /usr/bin/pfcsh
/usr/bin/pfksh /usr/bin/pfsh
/usr/bin/sh /usr/bin/tcsh
/usr/bin/zsh /usr/xpg4/bin/sh
The getusershell() function opens the file /etc/shells, if it exists, and returns the next entry in the list of shells.
The setusershell() function rewinds the file or the list.
The endusershell() function closes the file, frees any memory used by getusershell() and setusershell(), and rewinds the file /etc/shells.
RETURN VALUES
The getusershell() function returns a null pointer on EOF.
BUGS
All information is contained in memory that may be freed with a call to endusershell(), so it must be copied if it is to be saved.
SunOS 5.10 30 Aug 2004 getusershell(3C)