Search Results

Search: Posts Made By: jayakhanna
43,887
Posted By jayakhanna
egrep -v " +" filename This will do the...
egrep -v " +" filename

This will do the trick of removing more than one spaces line also

Regards
JK
21,590
Posted By jayakhanna
I am not getting your problem, it would be nice...
I am not getting your problem, it would be nice if you can post your code here

Regards
JK
9,636
Posted By jayakhanna
echo -n "" > somefile Regards ...
echo -n "" > somefile

Regards
JK
20,614
Posted By jayakhanna
ps -l pid will show show the status of a process...
ps -l pid will show show the status of a process for you besides other things

you can see man page what are the states (R for running and so on )

Regards
JK
12,219
Posted By jayakhanna
Another one is Services For Unix by Microsoft ...
Another one is Services For Unix by Microsoft

http://www.microsoft.com/windows/sfu/

Regards
JK
3,929
Posted By jayakhanna
You could very well change the sequence, just...
You could very well change the sequence, just read the man page for *date*, it has more informations

date -u +%Y%m%d

data_file is the file in which you have your sequence of dates ie
...
3,929
Posted By jayakhanna
I am not clear with your question, I assume you...
I am not clear with your question, I assume you are asking for today' s date 29122003 to be searched in a file, then the below will work

str=`date -u +%d%m%Y`
grep $str filename

if [ $? -ne 0...
11,217
Posted By jayakhanna
I am really sorry I was just checking the octal...
I am really sorry I was just checking the octal value for \n.
Okay any how the program should be like this

echo "Enter answer"
read answer

if [ "$answer" = "" ]
then
echo "You must enter a...
11,217
Posted By jayakhanna
echo "Enter answer" read answer echo...
echo "Enter answer"
read answer

echo $answer | od -b

if [ "$answer" = "" ]
then
echo "You must enter a file name"
exit 1
else
cat $answer
fiRegards
JK

added...
21,438
Posted By jayakhanna
ls -l | awk '{ if ($5 < 2000) { print $0 }}' ...
ls -l | awk '{ if ($5 < 2000) { print $0 }}'


Regards
JK
3,865
Posted By jayakhanna
I could think of this simple method i=`ls -1...
I could think of this simple method

i=`ls -1 /tmp /var/tmp | wc -l`

while [ true ]
do
sleep 1
j=`ls -1 /tmp /var/tmp | wc -l`
if [ $j -gt $i ]
then
echo "A...
6,468
Posted By jayakhanna
one more way echo "" >junk :D ...
one more way

echo "" >junk
:D

Regards
10
2,616
Posted By jayakhanna
Yeah I was very well aware that both of the...
Yeah I was very well aware that both of the variable are same, I assumed that he actually wanted a file name which is equivalent to the answer variable

Thanks and Regards
JK
10
2,616
Posted By jayakhanna
I suppose this is what you were intending to do ...
I suppose this is what you were intending to do

Regards
JK

echo " a.read a file"
echo " b.create a file"
echo " c.add on existing file"
echo " d. exit"

while [ true ]
do
echo "Enter...
14,905
Posted By jayakhanna
Yeah that is a workaround that will do, But...
Yeah that is a workaround that will do,

But I am really wondering how to do the following

suppose I am using getopt function, in a C program and try to caputre the arguments with the -x option...
14,905
Posted By jayakhanna
I wan' t a system call and need not want to...
I wan' t a system call and need not want to tokenize either, I just want to execute the way as normal program does.

./a.out -k abc def -x adf ghi

Regards
JK
14,905
Posted By jayakhanna
Parsing the command line arguments
Is there a way to get the command line arguments.

I am using getopt(3) but if the arguments are more than one for a particular option than it just ignores the second argument. For eg

./a.out -x...
3,921
Posted By jayakhanna
You can use also this, this is much simpler ...
You can use also this, this is much simpler

find / -name filename | wc -l

Regards
JK
1,508
Posted By jayakhanna
You can try SFU (Services For Unix) by Microsoft...
You can try SFU (Services For Unix) by Microsoft also, It is freely available

Regards
JK
3,921
Posted By jayakhanna
find ./ filename | grep -x "filename" | wc -l ...
find ./ filename | grep -x "filename" | wc -l

It would have been better if you had come with this solution rather than me, just try around and play with unix you can find lot more stuffs and you...
3,921
Posted By jayakhanna
For second query cp -R JUNK JUNK1 JUNK...
For second query

cp -R JUNK JUNK1

JUNK is the existing directory
JUNK1 is the non-existing directory, if the directory exists then JUNK will be its sub-directory

For third query

find ./...
3,921
Posted By jayakhanna
Well to find out whether a file is executable...
Well to find out whether a file is executable under a directory, I cannot think of any command as such present in unix, I doubt whether there is any. You can use this script to find out the...
56,943
Posted By jayakhanna
Well I am not too sure what you exactly want the...
Well I am not too sure what you exactly want the output to be but sort +1 -2 +3 -4 will sort the output based on 2nd field and if second field is same it will see the next specified field in this...
5,472
Posted By jayakhanna
You can try this way also if you want as a single...
You can try this way also if you want as a single command to be executed one at a time

# export VAR="adafadfadf"
# export LENGTH=`expr "$VAR" : '.*'`
# echo $LENGTH
10
# export VAR=""
#...
5,472
Posted By jayakhanna
# VAR="adfadf"; LENGTH=`expr "$VAR" : '.*'`; echo...
# VAR="adfadf"; LENGTH=`expr "$VAR" : '.*'`; echo $LENGTH

I doubt whether your syntax is correct, just use the above it will work correctly


If you want to get 0 for null string put VAR=""
...
Showing results 1 to 25 of 50

 
All times are GMT -4. The time now is 05:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy