Search Results

Search: Posts Made By: scriptor
7,043
Posted By scriptor
you can also try #!/bin/bash cd <PATH> ...
you can also try

#!/bin/bash
cd <PATH>
a=`(ls -lrt | grep "total 0")`
if [ $? == "0" ]
then
echo "no file
else
<your condition>
fi
17,315
Posted By scriptor
you can try below command awk -F"/" '{print...
you can try below command

awk -F"/" '{print $12}' <file_name> | awk -F"." '{print $1}'

or you can use

cut -d '/' -f 12 out.out | awk -F"." '{print $1}'
10,539
Posted By scriptor
thx Rudic for the explanation. $(NF-1) this...
thx Rudic for the explanation.

$(NF-1) this will print alpha and beta.
thx for explaining in easy way .
10,539
Posted By scriptor
What is $(NF) means?
HI

what does the $(NF) means.
here i want to understand the working.
what i know is that in awk NF argument will tell number of column in a file

i have below file
alpha
a
beta
b
if i...
2,211
Posted By scriptor
awk with For loop
Hi

My Requirement is to take the sum of each column
below is the input file.

1 2 3 4
1 2 3 4
1 2 3 4
Initial i was using below command to achieve my desired result. however this was...
729
Posted By scriptor
HI Have input file as below 1,1237537 ...
HI Have input file as below

1,1237537
2,57956
3,923
4,0
5,33
6,435208
7,67
8,1
9,14


I want o/p as below
1237537 57956 923 0 33 435208 67 1 14


but I am getting as below...
729
Posted By scriptor
Teriminal name priniting using awk
HI


I want to convert 2nd column to row. but I am getting terminal name also along with the o/p


I am using below command cat test | awk -F"," '{printf $2"\t" }'
getting below o/p
...
1,056
Posted By scriptor
thx MadeInGermany and Peasant
thx MadeInGermany and Peasant
1,056
Posted By scriptor
awk not clear
can anyone tell me the working of this logic.
here "last" is a variable or it has it own meaning . getting confused.


awk '{if (last && $2 != last) {print last, sum; sum=0}
sum=sum+ $3; last...
6,388
Posted By scriptor
1,801
Posted By scriptor
hi Andrew yes file is in /home this...
hi Andrew
yes file is in /home


this command o/p gives me echo /home/LOGS_*.gz
I get /home/LOGS_2018-08-20.tar.gz
1,801
Posted By scriptor
Du command not able to read file.
hi
when i am trying to check the file size using du command in shell script but getting a below error, although the file is present

du: cannot access `LOGS_18-08-20.tar.gz': No such file or...
3,064
Posted By scriptor
Hi Andrew, yes the path is same when I run...
Hi Andrew,
yes the path is same when I run manually or when it runs from cron.


below error I get when script run from cron



# log
+ log
spawn sftp AUT@xx.xx.xx.xx
Connecting to...
3,064
Posted By scriptor
Hi Andrew, My current problem is that...
Hi Andrew,


My current problem is that when I am trying to run my script by scheduling it in cron it did not work.
however when the same script I run manually it works.


this issue I am not...
3,064
Posted By scriptor
can anyone help me
can anyone help me
3,064
Posted By scriptor
Hi I have resolved the above error by...
Hi


I have resolved the above error by setting timeout time.
now the script is running fine but when I tried to run through it is showing error and state file not found


script mentioned...
3,064
Posted By scriptor
HI RUDIC, thx for help. I have noticed...
HI RUDIC,
thx for help.


I have noticed another issue while running the script.
transferring of file getting closed in between. see below
LOGS_2018-08-02.tar.gz 23% 10MB ...
3,064
Posted By scriptor
script is not working whether I do echo or not. ...
script is not working whether I do echo or not.
I have using echo in my script to just check if I m using the date command set DATE [exec date -d "1 day ago" +%Y_%m_%d] correct or not.


although...
3,064
Posted By scriptor
Getting error while using date as a variable in expect
Hi
getting error when i am saving date command output in a variable and then using the same variable in expect
#!/usr/bin/expect
set DATE [exec date -d "1 day ago" +%Y_%m_%d]
spawn sftp...
873
Posted By scriptor
Hi Don, ok I got it. here my concern...
Hi Don,

ok I got it.
here my concern is why password is accepting when trying with unix server but same working fine when using sftp tool GUI
873
Posted By scriptor
Hi Don, even if I use below command,...
Hi Don,

even if I use below command, password is not accepting

sftp root@xx.xx.xx.xx


but same password is working fine when I am using winscp tool Gui to transfer the file
873
Posted By scriptor
How to sftp fron UNIX to window server using expect?
HI
I am using expect to transfer the file from unix system to windows server.
however it is not taking the password.
same I tried without script also but still it is not accepting the password.
...
Forum: Programming 05-30-2018
1,541
Posted By scriptor
HI Rudic, can you guide me where to add...
HI Rudic,

can you guide me where to add new line and how
Forum: Programming 05-30-2018
1,541
Posted By scriptor
HI Rudic, below is the code ...
HI Rudic,

below is the code

import java.io.*;
class A1
{
public static void main (String agrs[])
{
byte[] b = {'a','e','i','o','u'};
String s = "King Maker";
try
{...
Forum: Programming 05-30-2018
1,541
Posted By scriptor
hi Corona thx a lot for help getting o/p as...
hi Corona
thx a lot for help getting o/p as expected
[root@1s home]# java A1
AaeiouKing Makerhappy.


however when I open the file which I created is showing O/P as below

...
Showing results 1 to 25 of 206

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