when I do
$ ls z*
List of all files begining with 'z'. But what if I want to do a reverse lookup. Just for interest sake ;)
$ ls ztr
should be same as
$ ls ztr*
$ ls zt*
$ ls z* (2 Replies)
Hi Everybody,
I want to write a script in unix which will automatically FTP a .txt file from my client machine D: drive(Windows)
That is I want to FTP a file from my PC to UNIX box but this should be done from UNIX box by a shell script. (i.e. I will invoke the script in UNIX and FTP will be... (4 Replies)
Hello,
How do i sort a csv file. i should be sorting column1(varchar),column2*(varchar) in ascending and column4 in descending order(numeric datatype).
I tried few combinations of sort, but doesn't seem to be getting the right result.
sort -t "," -k 1 -k 2 -k 4nr file
any help is... (3 Replies)
i have created a script that will reverse any given ineter.
#!/bin/ksh
echo "Enter the number"
read n
if
then
a=`expr $n / 10`
b=`expr $n % 10`
c=`expr $b \* 10 + $a`
fi
echo $c
---------------------------------------------------------------------
the problem with this script... (4 Replies)
Hello guys
How can I use egrep to match word1 but not word2...word1.
What I mean
suppose that I have the following text, and my word1=pizza and word2=eat
I hate to eat pizza because I ma eating it each day
Pizza is good
I like vegetarian and Italian Pizza
eating healthy food is... (7 Replies)
Hi All,
I have a String str="Manish". I would like to reverse it.
I know the option to do this in bash is: echo "Manish" | rev
but I have seen an alternate solution somewhere, which states that:
str="Manish" echo $str | awk '{ for(i=length($0);i>=1;i--) printf("%s",substr($0,i,1));... (7 Replies)
Discussion started by: manishdivs
7 Replies
LEARN ABOUT OSX
strcspn
STRCSPN(3) BSD Library Functions Manual STRCSPN(3)NAME
strcspn -- span the complement of a string
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <string.h>
size_t
strcspn(const char *s1, const char *s2);
DESCRIPTION
The strcspn() function spans the initial part of the null-terminated string s1, as long as the characters from s1 do not occur in string s2
(it spans the complement of s2). In other words, it computes the string array index in s1 of the first character of s1 which is also in s2,
else the index of the first null character.
RETURN VALUES
The strcspn() function returns the number of characters spanned.
SEE ALSO memchr(3), strchr(3), strpbrk(3), strrchr(3), strsep(3), strspn(3), strstr(3), strtok(3)STANDARDS
The strcspn() function conforms to ISO/IEC 9899:1990 (``ISO C90'').
BSD June 4, 1993 BSD