Unix/Linux Go Back    

Showing results 1 to 25 of 48
Search took 0.01 seconds.
Search: Posts Made By: ailnilanjan
Forum: Shell Programming and Scripting Linux 02-05-2015
Replies: 3
Views: 657
Posted By ailnilanjan
Hello Rudic I am sorry if I was not clear...

Hello Rudic

I am sorry if I was not clear enough..:o

Problem I am facing here, Using the script I am not able to switch user to root in the remote Linux machine due to the error

su: must be...
Forum: Shell Programming and Scripting Linux 02-04-2015
Replies: 3
Views: 657
Posted By ailnilanjan
Switch user terminal error

Hello All,

Here I am trying to login a Linux machine as admin user from a Solaris box..

& then switch to root user..

Code I use:

ssh admin@<IP> << END
su - root << A
Forum: Shell Programming and Scripting Linux 02-04-2015
Replies: 4
Views: 627
Posted By ailnilanjan
Thanks.. That Idea helped!.. :b::b:

Thanks.. That Idea helped!.. :b::b:
Forum: Shell Programming and Scripting Linux 02-02-2015
Replies: 4
Views: 627
Posted By ailnilanjan
dont have -s to convert to epoc.. many...

dont have -s to convert to epoc.. many restrictions!:o
Forum: Shell Programming and Scripting Linux 02-02-2015
Replies: 4
Views: 627
Posted By ailnilanjan
Timestamp conversion

Hello All,

I have a file with many timestamps as in below format & example:

20150130105120

2015-> Year in YYYY
01-> Month in MM
30-> Day in DD
10-> Hour in HH
Forum: Shell Programming and Scripting Linux 01-19-2015
Replies: 2
Views: 411
Posted By ailnilanjan
Matching first 2 columns..

Hello All,

I want to make a file which will have primarily lines of file2 but when first 2 fields matches with the file1 it should have those lines of file1..

example is as below..

file1...
Forum: Shell Programming and Scripting Linux 01-15-2015
Replies: 12
Views: 927
Posted By ailnilanjan
Now I run this (Note: I changed TRE to tre).. ...

Now I run this (Note: I changed TRE to tre)..

/usr/xpg4/bin/awk 'NR==FNR {sub (/RSL /, "", $28)
T[$12]=$28
next
...
Forum: Shell Programming and Scripting Linux 01-14-2015
Replies: 12
Views: 927
Posted By ailnilanjan
Thanks AWK worked :D Thanks RudiC.. Seems I...

Thanks AWK worked :D

Thanks RudiC.. Seems I need to remember this..:o

But I am afraid why it returns nothing while I know atleast a case exists as below:confused::

File1 contains below...
Forum: Shell Programming and Scripting Linux 01-14-2015
Replies: 12
Views: 927
Posted By ailnilanjan
Getting below errors: awk: syntax error near...

Getting below errors:

awk: syntax error near line 1
awk: illegal statement near line 1
awk: syntax error near line 5
awk: bailing out near line 5



6116
Forum: Shell Programming and Scripting Linux 01-13-2015
Replies: 12
Views: 927
Posted By ailnilanjan
Thanks Skrynesaver.. I have other part of...

Thanks Skrynesaver..


I have other part of the main script which is written in a shell script.. Actually this is a part of a big shell script..:o

Can you please help me doing this job in bash...
Forum: Shell Programming and Scripting Linux 01-12-2015
Replies: 12
Views: 927
Posted By ailnilanjan
It is ";" Sorry I should mentioned it...

It is ";"

Sorry I should mentioned it already..:(
Forum: Shell Programming and Scripting Linux 01-12-2015
Replies: 12
Views: 927
Posted By ailnilanjan
How to match the below conditions?

Hello All,

I have 2 files with around 2k records.. I am lost how to build a script to create another file with the below:confused::eek:

Match Condition1:
File1's 12th Columns data should exact...
Forum: Shell Programming and Scripting Linux 11-06-2014
Replies: 6
Views: 466
Posted By ailnilanjan
Thanks Don, RudiC.. Both worked well..:b::b::b: ...

Thanks Don, RudiC.. Both worked well..:b::b::b:


I have fixed the mistakes I was making at my end related to file names..:(
Forum: Shell Programming and Scripting Linux 11-06-2014
Replies: 6
Views: 466
Posted By ailnilanjan
No success.. :( With /usr/xpg6/bin/awk: ...

No success.. :(

With /usr/xpg6/bin/awk:

input file "file[12]"

With /usr/xpg6/bin/awk
line 11: /usr/xpg6/bin/awk: No such file or directory

With nawk
Forum: Shell Programming and Scripting Linux 11-06-2014
Replies: 6
Views: 466
Posted By ailnilanjan
Replacing first field of file2 with the second filed of file1 for matching cases

Dear All,

Need your help..:D

I am not regular on shell scripts..:(

I have 2 files..


Content of file1
Forum: Shell Programming and Scripting Linux 05-10-2013
Replies: 13
Views: 1,125
Posted By ailnilanjan
i had problem with sort so i used hanson44's...

i had problem with sort so i used hanson44's code..

It ran perfectly..

awk '{cnts[$1]++} $2 > fld2[$1] {fld2[$1]=$2; fld0[$1]=$0} END {for (key in cnts) { if (cnts[key] >= 3) print fld0[key]...
Forum: Shell Programming and Scripting Linux 05-10-2013
Replies: 13
Views: 1,125
Posted By ailnilanjan
Showing the usage usage: sort [-cmu] [-o...

Showing the usage

usage: sort [-cmu] [-o output] [-T directory] [-S mem] [-z recsz]
[-dfiMnr] [-b] [-t char] [-k keydef] [+pos1 [-pos2]] files...
Forum: Shell Programming and Scripting Linux 05-10-2013
Replies: 13
Views: 1,125
Posted By ailnilanjan
I ran the command using input.txt content as X 9 ...

I ran the command using input.txt content as X 9
B 5
A 1
Z 9
T 4
C 9
A 4
C 3
B 2
T 7
Forum: Shell Programming and Scripting Linux 05-09-2013
Replies: 13
Views: 1,125
Posted By ailnilanjan
Printing uniq first field with the the highest second field

Hi All,


I am searching for a script which will produce an output file with the uniq first field with the second field having highest value among all the duplicates..

The output file will...
Forum: Shell Programming and Scripting Linux 05-07-2013
Replies: 17
Views: 8,950
Posted By ailnilanjan
tac not found in my box man tac No manual...

tac not found in my box

man tac
No manual entry for tac.


Below one worked perfectly & really smart way indeed :) :

printf '%s\n' 1,-500d w q | ed -s file 2>/dev/null
Forum: Shell Programming and Scripting Linux 05-06-2013
Replies: 17
Views: 8,950
Posted By ailnilanjan
Thanks all.. I see many responses!! .. :) ...

Thanks all..

I see many responses!! .. :)

I will try them one by one will respond by the end of the day..

Thank you all again...
Forum: Shell Programming and Scripting Linux 05-05-2013
Replies: 17
Views: 8,950
Posted By ailnilanjan
My purpose is to delete the lines except the last...

My purpose is to delete the lines except the last few..

For viewing the certain last few I would have used smaller one:

tail -3 t
Forum: Shell Programming and Scripting Linux 05-05-2013
Replies: 17
Views: 8,950
Posted By ailnilanjan
tail is not deleting.. various use of tail is...

tail is not deleting.. various use of tail is just displaying..

awk '(s-NR)<500' s=$(cat file | wc -l) file

is returning

"awk: can't open 664"

664 is actually the line number..
Forum: Shell Programming and Scripting Linux 05-05-2013
Replies: 17
Views: 8,950
Posted By ailnilanjan
Deleting all lines except last 500

Hi All,

I want to write a script which first check the line counts of a file if its more than 500 it deletes rest except the last 500..

I tried sed but it looks sed counts line numbers from the...
Forum: Shell Programming and Scripting Linux 05-05-2013
Replies: 3
Views: 652
Posted By ailnilanjan
Many thanks Vidyadhar & Yoda for your help... ...

Many thanks Vidyadhar & Yoda for your help...

I tried Yoda's code as it looked smaller & worked perfectly..

Now I need one more help.. It definitely should be another thread..
Showing results 1 to 25 of 48

 


All times are GMT -4. The time now is 06:34 PM.