Search Results

Search: Posts Made By: angad.makkar
2,397
Posted By angad.makkar
Just using your example, egrep "idxxx1|idxxx3"...
Just using your example,
egrep "idxxx1|idxxx3" file | awk '{print $1 "\t" $4}' | awk -F';' '{print $1}'

Step1:
$ egrep "idxxx1|idxxx3" file
$ idxxx1 something something ...
1,227
Posted By angad.makkar
Perl - DB Commits
Hello,

I have a problem with DB handling in Perl.

Module 1 ---calls--> Module 2

Module 1 creates a DB Connection and passes the DB handle to Module2.

In module 2, I perform some Selects...
2,674
Posted By angad.makkar
Or Simply
Simply do this:
grep -v XYZ > file_without_XYZ
1,900
Posted By angad.makkar
1. while read line 2. do 3. x=`echo $line |...
1. while read line
2. do
3. x=`echo $line | cut -d "," -f4`
4. cd $x
5. plant=`echo $line | grep $x | cut -d "," -f1 | head -1 `
6. done < $master_file


the 3rd line does the following:...
29,221
Posted By angad.makkar
grep -v option inverts the selection....i.e all...
grep -v option inverts the selection....i.e all the lines but those matching are printed.

Hence "grep -v '#'" will print all the lines which do not include a '#'.
5
Ssh
1,451
Posted By angad.makkar
Try this!!
Might be u will have to update this as per your needs...........


old_cnt=0
while true
do
cur_cnt=`last | grep "still logged in" | wc -l`
if [ $old_cnt -ne $cur_cnt ]
then
...
9,738
Posted By angad.makkar
Remove privledges from Testuser
try
chmod 554 /bin/ps


Provided u have root privledges for this command
1,904
Posted By angad.makkar
Try This:
#!/bin/sh

i=0
cat input | while read line
do
case $i in
0) str1=`echo $line | awk -F'#' '{print $2}'`;;
1) str2=`echo $line | awk -F'ON' '{print $2}'`;;
2) str3=`echo...
3,417
Posted By angad.makkar
HI, Does this help?? for files in `ls...
HI,
Does this help??

for files in `ls refresh*.dat`; do max_file=`echo $files | awk -F'refresh_' '{print $2}' | sort` ;done; echo refresh_$max_file;
63,490
Posted By angad.makkar
Hi Nirbhay I think this "0" is the return from...
Hi Nirbhay
I think this "0" is the return from the system("cat add") command.

Try this:
awk '{ if ( NR == 5 ) { print system("cat add") 1>/dev/null } else { print }}' input

redirecting...
1,894
Posted By angad.makkar
This works....
Hi Joyeg....

Just try this out:

#!/bin/bash

declare -a name_arr
declare -a size_arr

i=0
for files in `ls`
do
name=`ls -l $files | awk '{print $3}'`
size=`ls -l $files | awk...
15,071
Posted By angad.makkar
ioctl : strace
Hi All,

int ioctl(int d, int request, ...);

Can somebody tell me how does ioctl decides the input parameter: "request".

Sometimes, its SNDCTL_TMR_TIMEBASE or TCGETS
or FIONREAD...etc.
...
3,908
Posted By angad.makkar
To use the Shell variables, use "-v i.e....
To use the Shell variables, use "-v i.e. Variable" option in awk.

Do this:
fname=File$i
mypid=`ps aux | awk -v var="$fname" 'BEGIN /var/ && !/awk/ { print $2 }'`

Note, that your shell...
4,667
Posted By angad.makkar
PERL: NET::FTP..>Debug Messages
HI All,

NET::FTP->new($server, DEBUG=>1);

I need to get all the Debug Messages in an array or a file....

Please suggest!!
6,283
Posted By angad.makkar
Well return works amazingly well. Thanks a...
Well return works amazingly well.

Thanks a lot.

Mods....please close this thread as the answer given is the best!!
8,815
Posted By angad.makkar
The best way to use maths function is by "bc"...
The best way to use maths function is by "bc" command. It takes care of integer and float both.
Usage: echo the maths expression and pipe it to bc.
add:
===
$ echo "2+2" | bc
$ 4
$ echo...
6,283
Posted By angad.makkar
Exit from sourced script
Hello,
I have written a script (say chld.sh). its structure is as follows:

------------------------
#!/bin/sh

usage()
{
echo "chld.sh <param1> <param2>"
exit 0
}

chk_param_1()...
Showing results 1 to 17 of 17

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