Search Results

Search: Posts Made By: chacko193
1,025
Posted By chacko193
Can you show what is stored in this variables ...
Can you show what is stored in this variables
$FILE_$timestamp.csv

?
1,025
Posted By chacko193
Try: UYRD="$(echo $FILE | awk...
Try:

UYRD="$(echo $FILE | awk '{gsub(".var","")}1')_${timestamp}.csv"
1,227
Posted By chacko193
Try: awk 'NR==FNR{arr[$1]=$2;next}{for(ele in...
Try:
awk 'NR==FNR{arr[$1]=$2;next}{for(ele in arr) {if ($1 ~ ele) {$1=arr[ele]}}}1' file1 file2
Forum: Programming 07-22-2014
12,213
Posted By chacko193
When you declaredisplay() in the derived class,...
When you declaredisplay() in the derived class, it hides the base class display() instead of overloading it. So when you call the display() using a derived class object, you will get an error since...
978
Posted By chacko193
Or try: awk '{ORS=""}1'...
Or try:

awk '{ORS=""}1' testcode.txt
1,978
Posted By chacko193
There is a typo in my last post. There should...
There is a typo in my last post. There should have been no space in the assignment operation.


# cat testIn
abc.conf
authpriv.* /var/log/secure...
Forum: AIX 06-10-2014
7,443
Posted By chacko193
Lets say you want to disable ls. First find where...
Lets say you want to disable ls. First find where the executable is:

which ls
/usr/bin/ls
This will give you the actual file name. Now rename it:

mv /usr/bin/ls /usr/bin/ls_disabled
And if...
2,127
Posted By chacko193
Does the file exists? The error is coming because...
Does the file exists? The error is coming because the script is unable to find the input file. Try giving the full path to the input file or else it will check for the input file in cwd.
Forum: Programming 05-14-2014
3,309
Posted By chacko193
file.dat 0x1A0A0 0x10000 0x1A480 0x3FFFF...
file.dat

0x1A0A0 0x10000 0x1A480 0x3FFFF 0x3FFFF 0x3FFFF 0x3FFFF 0x3FFFF
0x13E01 0x10000 0x12801 0x3FFFF 0x3FFFF 0x3FFFF 0x3FFFF 0x3FFFF
0x10400 0x10000 0x10410 0x3FFFF 0x3FFFF 0x3FFFF 0x3FFFF...
Forum: Programming 05-14-2014
1,175
Posted By chacko193
If by data[25] to data[31] you mean the 7 LSB of...
If by data[25] to data[31] you mean the 7 LSB of value, try:

bitset<7> trimmedData(value);
unsigned long decOfTrimmedData = trimmedData.to_ulong();
If you want MSB

data >>= 25;
unsigned long...
Forum: Programming 05-14-2014
1,175
Posted By chacko193
That maybe, but she is using them two at time
That maybe, but she is using them two at time
1,029
Posted By chacko193
Welcome to the forum. Please wrap your codes in...
Welcome to the forum. Please wrap your codes in code tags.

As to your question, you may have to provide the full path to date. Like:

/bin/date +%Y-%m-%d --date=" 10 days ago"
959
Posted By chacko193
Try: awk -F"|"...
Try:
awk -F"|" 'NR==FNR{col1[$1]=$1;col2[$1]=$2} NR>FNR && $1 in col1{printf("\"%s\",\"%s\",\"%s\",\"%s\"\n",col1[$1],col2[$1],$1,$2)}' file1 file2
for the first part.

For info on awk go...
Forum: Solaris 04-28-2014
2,724
Posted By chacko193
Its not "you" that run the script. Its the cron...
Its not "you" that run the script. Its the cron daemon that runs it. And the cwd of the cron daemon is the root directory, unless you change it in your script. In your script you are not changing the...
11,817
Posted By chacko193
Try giving full path to service. Like : ...
Try giving full path to service. Like :

/sbin/service $SERVICENAME status > /dev/null
3,726
Posted By chacko193
getopts might help you. Have a look at this...
getopts might help you. Have a look at this sample script:

m@home$cat test.sh
#! /bin/bash

#An array to hold the values passed using -c option
declare -a c_arr

#The count of -c options...
1,242
Posted By chacko193
What it does is run the rsync command and save it...
What it does is run the rsync command and save it output to the log file. It also saves the exact command that is executed, i.e., the arguments that is passed to the rsync and "Done" when the command...
2,127
Posted By chacko193
Try: ...
Try:

open(FH,"</path/to/your/file/filename");
my @file = <FH>;
close FH;
my $line;
foreach $line (@file) {
if ( $line ~= m/1/) {
#Do your thing.
} elsif { $line ~= m/0/) {
...
2,879
Posted By chacko193
Try this sample code: #!/bin/bash su -l...
Try this sample code:

#!/bin/bash
su -l guest -c "export a=$1;export b=$2;echo \`whoami\`>/tmp/me;echo \$a >/tmp/a;echo \$b>/tmp/b"
echo Now I am
whoami
echo -----------
echo Contentes of...
16,510
Posted By chacko193
Try: for file in /path/to/your/directory/* ...
Try:

for file in /path/to/your/directory/*
do
fname=${file##*/} #This gives your base filename.
fpath=${file%/*} # Your dir
dname=${fpath##*/}
mv $file ${fpath}/${dname}.${fname}
done
1,339
Posted By chacko193
It might have been used by the developer for...
It might have been used by the developer for debugging purposes. There might have been a condition there earlier for debugging and now its been replaced by true.
9,043
Posted By chacko193
Here you seemed to have missed the second single...
Here you seemed to have missed the second single quote for find. Its not closed.

You can also try it this way:

ssh -q -o ControlPath=/home/kraut/.ssh/cm_socket/%r@%h:%p_13929 uname@ip 'ls -l...
1,198
Posted By chacko193
Or you can just use sed: sed...
Or you can just use sed:

sed '/^aternqaco\./d' infile >tmpFile
2,101
Posted By chacko193
To get rid of the error try : if [ "$i" =...
To get rid of the error try :

if [ "$i" = "puma" ] ; thenand here better use a double quote for sed instead of the single:

ps -ef|grep puma|grep -v grep|sed -n '2,$p' |awk -F ' ' '{print...
2,874
Posted By chacko193
You can use the option sftp -o...
You can use the option sftp -o NumberOfPasswordPrompts=0 to exit if the ssh key does not work.
Showing results 1 to 25 of 31

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