Search Results

Search: Posts Made By: ankur328
3,279
Posted By ankur328
Sequential Reading from two file in a loop
Hello All,

I have two files with me file1.txt and file2.txt

file1.txt has:

333
222
111

file2.txt has

ccc
bbb
aaa

ccc is related to 333 only, bbb is related to 222 only and aaa...
847
Posted By ankur328
Used this to have them in a single line: awk...
Used this to have them in a single line:

awk '{printf "%s%s",$0,(NR%2?FS:RS)}' filename

now i am getting like this:

736f14c4-eda2-4531-9d40-9de4d6d1fb0f An account already exists for this...
847
Posted By ankur328
Formatting in a table via shell
Hi

I have the below output:

736f14c4-eda2-4531-9d40-9de4d6d1fb0f
An account already exists for this email address. Please enter a different email address.
c3716baf-9bf8-42da-8a44-a13fff68d20f...
5,774
Posted By ankur328
Thanks to both of you... I got the answer as...
Thanks to both of you...

I got the answer as to why it was splitting.

By default, a Bash for loop splits on all whitespace. You can override that by setting the IFS variable:

IFS=$'\n'
for...
5,774
Posted By ankur328
Desired output should be: ...
Desired output should be:
...
5,774
Posted By ankur328
awk printing output to new line
Hi

I have a file profile.txt with the below input:
...
2,000
Posted By ankur328
Hi Its still not working. i removed quotes...
Hi

Its still not working. i removed quotes from everything:

See below:

cd /opt/app/abc/
abcversion=abc* (abcga5 is inside /opt/app/abc/)
echo $abcversion

echoresult:

abcga5
...
2,000
Posted By ankur328
I tried removing the quotes and here are the...
I tried removing the quotes and here are the results:

export local_folder=/opt/app/
cd /opt/app/abc/
abcversion=abc* (abcga5 is inside /opt/app/abc/)
echo $abcversion (it echoes the correct...
2,000
Posted By ankur328
Variable Assignment
Hi

I am facing a problem.

export local_folder=/opt/app/
cd /opt/app/abc/
abcversion="abc*" (abcga5 is inside /opt/app/abc/)
echo $abcversion (it echoes the correct version as abcga5 )
...
1,060
Posted By ankur328
Same Variable Assignment
Hi

I have a strange problem:

In my shell script I am performing a copy task:

. prop.txt
cp -r $dir/ $dir/archive

$dir is fetched from a property file (prop.txt) which stores its value
...
2,033
Posted By ankur328
thats brilliant Rudy, Many thanks...
thats brilliant Rudy, Many thanks...
2,033
Posted By ankur328
Hi Rudi, Yes you are correct. Any way to...
Hi Rudi,

Yes you are correct. Any way to check both the conditions?

Also *.log are the on;ly files present in the folders, so I am fail safe in this egrep.

Thanks
2,033
Posted By ankur328
Conditional OR in shell
Hi

I have been trying to write a simple code:

if [[ `(ls -A $apache_log_dir | egrep *.log)` ]] || [[ `(ls -A $jboss_log_dir | egrep *.log)` ]]
then
echo "Log Directory is not empty, we will...
880
Posted By ankur328
Syntax Error Problem
Hi

Below script is throwing an error:

repos=root
filename=/home/admin/Desktop/authz
case $repos in
root)
root_folder="\[\/\]"
do

sed "/$root_folder/a $username = $access" $filename...
1,002
Posted By ankur328
Hi Rudi, I appreciate your view on the same...
Hi Rudi,

I appreciate your view on the same but my Manager isnt ;). However I have figured out a way to do it:


sed -i "/^$group = / s/$/, $user/" filename


Suggest me if this is fine....
1,002
Posted By ankur328
Search and Insert
I have a following file:

# User defined in group
[groups]
admin = boss, sysadmin
phpteam = php1, php2, php3
rubyteam = ruby1, ruby2

# SVN root should only be access by boss and system...
2,798
Posted By ankur328
sed - Exact pattern matching and replace
Hi Team,

I am facing a problem as under, Suppose I have a file (test.txt) with the below content (all braces and slashes are included in the contents of the file)

[/]
[/abc/rep]
[/ab/cd/ef]
...
6,693
Posted By ankur328
Also the other one: bash-3.2$ cat...
Also the other one:

bash-3.2$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.10 (Tikanga)
6,693
Posted By ankur328
haha, actually it was my server name. :P. The...
haha, actually it was my server name. :P. The screenshot was caught by SNIP tool in window. I have logged in to remote server via putty.
6,693
Posted By ankur328
So is there any other way to capture the SS via...
So is there any other way to capture the SS via terminal?
6,693
Posted By ankur328
Hi Attached the SS of uname -a Thanks
Hi

Attached the SS of uname -a

Thanks
6,693
Posted By ankur328
I am running Linux on remote server and has...
I am running Linux on remote server and has connected to it via putty.

My Machine is Windows 64 Bit Build 7601, 6.1

Thanks
6,693
Posted By ankur328
Hi Yup got your point. System Details: ...
Hi

Yup got your point.

System Details:

Linux 2.6.18-371.9.1.el5 #1 SMP Tue May 13 06:52:49 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

Thanks
Ankur
6,693
Posted By ankur328
Shell Script to Capture a Screenshot
Hi All,

Suppose I want to take a screenshot of a website say Google (http://www.google.com) and save that image. How should I do it?

I tried wget with this but of no help. It just makes a...
Forum: Web Development 08-25-2014
2,953
Posted By ankur328
yes Listen directive is present,On hosts on which...
yes Listen directive is present,On hosts on which this works fine has

Listen ip_abc:8081 in httpd.conf and ip_abc:8081 in vhost.

But the same config is not picked by other new vhost and gives...
Showing results 1 to 25 of 71

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