Search Results

Search: Posts Made By: codemaniac
Forum: Solaris 08-21-2013
2,750
Posted By codemaniac
GNU grep (/usr/sfw/bin/ggrep) is generally...
GNU grep (/usr/sfw/bin/ggrep) is generally installed at system in /usr/sfw/bin.
10,909
Posted By codemaniac
okay if you are not using GNU find then i guess...
okay if you are not using GNU find then i guess maxdepth will not be available.

You can do something like below using prune to not descending to and directory other than "dir".
find...
4,033
Posted By codemaniac
try using printf. :) prstat 1 1 | awk...
try using printf. :)

prstat 1 1 | awk '{printf ("%10s %10s %10s %10s\n",$1,$2,$9,$10)}'
1,387
Posted By codemaniac
okay, the below cron entry will get file once...
okay, the below cron entry will get file once daily at 8:30 pm.

30 20 * * * /home/test/scripts/example.sh
10,909
Posted By codemaniac
the gnu find has a maxdepth option that lets you...
the gnu find has a maxdepth option that lets you restrict the search to the current directory.

can you try something like below.

find . -maxdepth 1 -mtime +30
10,909
Posted By codemaniac
you can find the files older than 30 days and...
you can find the files older than 30 days and archive them with the below commandline.

find . -mtime +30 | xargs tar cvzf archive.tar

remove files older than 30 days with the below commandline....
2,570
Posted By codemaniac
try sed "s/Winston (UK) Wong/7000/"...
try
sed "s/Winston (UK) Wong/7000/" tmp0.txt
2,003
Posted By codemaniac
You can use associative arrays like below , ...
You can use associative arrays like below ,

awk -F"," '{math[$9]+=$22;}END{for (i in math) {print i,math[i]}}' sampleInput.txt
3,123
Posted By codemaniac
echo "you are how Hi" | awk 'BEGIN{RS=" ";ORS="...
echo "you are how Hi" | awk 'BEGIN{RS=" ";ORS=" "}{arr[NR-1]=$1;num++}END{for (i=num-1;i>=0;i--)print arr[i]}'
Forum: Programming 03-16-2012
16,894
Posted By codemaniac
regular expressions are not part of Standard C,...
regular expressions are not part of Standard C, you might find some
libraries for it. All i can suggest is searching for PCRE might give you something .
Forum: Red Hat 03-11-2012
2,324
Posted By codemaniac
You can also edit the /etc/sudoers file and allow...
You can also edit the /etc/sudoers file and allow specific users to shutdown or reboot the system .Something like that .
## Allows members of the users group to shutdown this system
# %users ...
2,978
Posted By codemaniac
use ls with find , something like below . ...
use ls with find , something like below .

find "/abc/xyz/pqr/$INPUTDIR" -type f -ls
Forum: Programming 03-06-2012
1,145
Posted By codemaniac
Does the below suffice your requirement ? ...
Does the below suffice your requirement ?
Result=$(echo "Absoulte_Markup_XYZ.xml" | cut -d "." -f1 | awk -F "_" '{print $NF}')
12,958
Posted By codemaniac
Hello friend , You need to modify your looping...
Hello friend ,
You need to modify your looping part as below

for i in $(ls *-.sql)
do
((n++))
done
echo "Number of conversions is $n"
1,962
Posted By codemaniac
Hello , You want to do something like that ....
Hello ,
You want to do something like that . huh?
for CLIENT in $(cat clientlist)
do
for POLICY in $(bppllist -byclient $CLIENT | grep "CLASS " | awk '{print $2}')
do
...
8,548
Posted By codemaniac
Try something like ps -eo pri,psr,pcpu,stat...
Try something like

ps -eo pri,psr,pcpu,stat | awk '{if($3 >= 25)print $0}'
4,783
Posted By codemaniac
Hello Bala , In addition to your solution ,...
Hello Bala ,

In addition to your solution , i would like to add the increment part of index , can also be done below .

((i+=1))
5,104
Posted By codemaniac
instead of using -v switch to pass the SHELL...
instead of using -v switch to pass the SHELL variable to the awklet ,you can use like below .

awk '$1==a' a=$NU input-file
2,993
Posted By codemaniac
Associative arrays are just live savers in these...
Associative arrays are just live savers in these needs

awk '{arr[$1]++}END{for (i in arr) {print i "-" arr[i]}}' uniq.dat
2,720
Posted By codemaniac
egrep or grep with an 'e' switch can also serve...
egrep or grep with an 'e' switch can also serve your purpose .

grep -e $trans -e $reason file

OR

egrep ($trans| $reason) file
1,618
Posted By codemaniac
Dear friend , Can you please let us know if...
Dear friend ,
Can you please let us know if the below command line satisfies your requirement ?


echo "/5/6/7" | awk -F "/" '{for (i=1;i<=NF;i++){if (i==1){continue}printf " -k " $i "n"}}'
3,123
Posted By codemaniac
Please try this below command line , i am not...
Please try this below command line , i am not currently in a unix box .

find . -type f -exec ls -1 {} \; | awk -F "/" '{ print $NF }'
2,814
Posted By codemaniac
Hello Aish11 , In order to remove the %...
Hello Aish11 ,

In order to remove the % symbol in your sample input file use

for i in `cat df_fnl.txt | sed 's/%//g'`

Does the below code segment is what you need ?

df_threshold=90;...
Showing results 1 to 23 of 23

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