It is not exactly clear to me which size is right or wrong, but that's just a matter of changing "-eq" into "-ne" or changing "-gt" into "-ge", "-le", -lt" or whatever.
Hi
how to check input is "empty" and "numeric" in ksh?
e.g:
./myscript.ksh k
output show: invalid number input
./myscript.ksh
output show: no input
./myscript.ksh 10
output show: input is numeric (6 Replies)
Hi All,
Can't find any documentation on the web for this anywhere, except about three web pages that are in Chinese.
When I enter SMIT on this box, I get
ERROR MESSAGE: Unable to open temp file
I suspected smit.log, but it is universal readable, writeable by root, and I am root.... (6 Replies)
keep getting an error when I try to revert to a snapshot:
"VMDB Failure" followed by "Unable to open snapshot file"
Im using vmware server 1.0.4, host OS is windows xp and guest OS is SLES.
Is there anything I can do to recover the snapshot or am I in trouble!?!?! (0 Replies)
Hi,
I've modified the syslogd source to include a thread that will keep track of a timer(or a timer thread). My intention is to check the file size of /var/log/messages in every one minute & if the size is more than 128KB, do a echo " " > /var/log/messages, so that the file size will be set... (7 Replies)
Hi all,
First off, sorry for a long post but I think I have no other option if I need to explain properly what I need help for.
I need some advise on how best to check for "faulty" or "stalled/jammed' print queues. At the moment, I have three (3) application servers which also acts as print... (0 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi
How to increase maximum number of open file in "sco xenix binary" running in "sco unix openserver 5.0.7" ?
I have changed "NOFILES" kernel parameter to 512, but xenix binray can't open more than 60.
tnx (4 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hi All,
i am trying to ssh to a remote machine and execute certain command to remote machine through script.
i am able to ssh but after its getting hung at the promt and after pressing ctrl +d i am gettin the out put as
expect: spawn id exp5 not open
while executing
"expect "$" {... (3 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT OPENSOLARIS
dirname
dirname(3C) Standard C Library Functions dirname(3C)NAME
dirname - report the parent directory name of a file path name
SYNOPSIS
#include <libgen.h>
char *dirname(char *path);
DESCRIPTION
The dirname() function takes a pointer to a character string that contains a pathname, and returns a pointer to a string that is a pathname
of the parent directory of that file. Trailing '/' characters in the path are not counted as part of the path.
If path does not contain a '/', then dirname() returns a pointer to the string "." . If path is a null pointer or points to an empty
string, dirname() returns a pointer to the string "." .
RETURN VALUES
The dirname() function returns a pointer to a string that is the parent directory of path. If path is a null pointer or points to an empty
string, a pointer to a string "." is returned.
ERRORS
No errors are defined.
EXAMPLES
Example 1 Changing the Current Directory to the Parent Directory.
The following code fragment reads a pathname, changes the current working directory to the parent directory of the named file (see
chdir(2)), and opens the file.
char path[[MAXPATHLEN], *pathcopy;
int fd;
fgets(path, MAXPATHLEN, stdin);
pathcopy = strdup(path);
chdir(dirname(pathcopy));
fd = open(basename(path), O_RDONLY);
Example 2 Sample Input and Output Strings for dirname().
In the following table, the input string is the value pointed to by path, and the output string is the return value of the dirname() func-
tion.
+-----------------------------+-----------------------------+
| Input String | Output String |
+-----------------------------+-----------------------------+
|"/usr/lib"" |"/usr" |
+-----------------------------+-----------------------------+
|"/usr/" |"/" |
+-----------------------------+-----------------------------+
|"usr" |"/" |
+-----------------------------+-----------------------------+
|"/" |"/" |
+-----------------------------+-----------------------------+
|"." |"." |
+-----------------------------+-----------------------------+
|".." |"." |
+-----------------------------+-----------------------------+
USAGE
The dirname() function modifies the string pointed to by path.
The dirname() and basename(3C) functions together yield a complete pathname. The expression dirname(path) obtains the pathname of the
directory where basename(path) is found.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO basename(1), chdir(2), basename(3C), attributes(5), standards(5)SunOS 5.11 18 Mar 2002 dirname(3C)