Search Results

Search: Posts Made By: nag_sathi
927
Posted By nag_sathi
awk question
Hi All,

I am studying the AWK tutorial and found this line of code and unable to understand correctly.

Q - Print the length of the longest input line:

awk '{ if (length($0) > max) max =...
Forum: Programming 07-05-2019
2,566
Posted By nag_sathi
Always giving the answers as 1
Hi,

I have wrote a python program to sum the numbers in a list.However its giving answer one.

Please advise.

MyList = []
Number = int(input("Please enter number:"))
for i in range(1,...
2,261
Posted By nag_sathi
Hi Don, can you explain how this reg ex...
Hi Don,


can you explain how this reg ex will parse and give the output.I have understand a little the $ represent end of a line and * is all lines, but i didn't get the other things.



sed...
1,025
Posted By nag_sathi
Query on Code
Hi All,

Can some one please explain the below code. Especially the %,* How it renaming the files and removing last field

for file in *.gz.*
do
echo mv $file ${file%\.*}
done

i/p...
1,557
Posted By nag_sathi
Thanks Rudic. It working perfectly.Can...
Thanks Rudic.


It working perfectly.Can you explain the below code.


t=${i/"file"/"newfile"}

--- Post updated at 12:27 PM ---

Hi Don,


Apologies for delay message. My request is...
1,557
Posted By nag_sathi
HI Don, Thanks for the reply. My...
HI Don,


Thanks for the reply.


My OS have rename command, however i want to solve that by using sed or awk.


I need to change all file names. My system details below.

...
1,557
Posted By nag_sathi
Renaming files - error
set -vx

for i in ~/Shell_Practice/rename/*.txt
do
t=`(echo $i | awk gsub("file","newfile"))`
mv $i $t
done
while running the above code getting below error.Please help.

...
982
Posted By nag_sathi
Renaming file - Query
Hi,

I have file with format abcd.gz.20151011.1 , i need to rename as abcd.gz.20151011.we can use move command for one file. How to change multiple files.
22,476
Posted By nag_sathi
Find command mmin
Hi,

Please tell me what the below command wil do, according to my understanding it finds files in the current and sub directories whose modification time is 5 hrs and it dont zip the already...
1,703
Posted By nag_sathi
Hi All, Thanks for the response. If i...
Hi All,

Thanks for the response.

If i want to zip only log files and omit all existing zipped files,other files.

is the below work

find . -type f -name "tomcatfiles*log" -mtime +90 !...
1,703
Posted By nag_sathi
Three month old specific files deletion
Hi,

I need to delete 3 month old files in my logpath. This path contains several logs and other important files

The file names are be like this

sl_details.env
tomcatfiles_03062014.log...
925
Posted By nag_sathi
Package release on UNIX environment
Hi,

Can some one tell what is Package release on UNIX environment.

Thanks, Nag
968
Posted By nag_sathi
UNIX command to know the applications
Hi,

I have a unix server, I want to know which user applicaions are running on that server. Is there any command ?

Thanks
1,329
Posted By nag_sathi
Thanks, it worked(unix2dos)
Thanks, it worked(unix2dos)
1,329
Posted By nag_sathi
[Solved] Downloaded file is not correct format
Hi,

Recently we migrated an application in HP UX to Linux. The files(scripts & logs)download from HP UX coming in a formatted way in MS notepad. However the files in Linux are not in correct...
1,626
Posted By nag_sathi
Hi Peasant, I have checked that folder it...
Hi Peasant,

I have checked that folder it contains only root as a file, does that mean only one user there.

If multiple user exist for cron, that folder /var/spool/cron have multiple entires.
...
1,626
Posted By nag_sathi
Jobs running in a server
Hi,

I need to know the jobs running in a server for all users in linux, crontab -l
gives for particular user, how ever I need for all users. I have sudo user access.

Thanks
1,713
Posted By nag_sathi
Hi Skrynesaver, Can you explain the code. ...
Hi Skrynesaver,

Can you explain the code.

WORKFLOW_START_TIME=$(perl -e '@t= localtime(time() + (5 *(60 * 60 )));printf "%02d/%02d/%04d %02d:%02d:%02d\n", $t[4] + 1, $t[3],$t[5]+1900,...
1,097
Posted By nag_sathi
File format issue
Hi All,

In unix is there any command to format the file in exact order.I have a file which there is no order in the fileds, I need to order it. Its a dat file

wrong format
...
1,713
Posted By nag_sathi
Hi RudiC, Its not working, $ date Tue...
Hi RudiC,

Its not working,

$ date
Tue Jun 11 15:31:03 GMT 2013
$ date -d"+5hours" +%H:%M:%S
date: illegal option -- d
date: illegal option -- +
date: illegal option -- 5
date: illegal...
1,713
Posted By nag_sathi
Additional time to system time
Hi All,

Is there any command to add additional time to date command. I need to add 5 hours to the present system time. I am getting the time by using date command.

WORKFLOW_START_TIME=`date...
1,622
Posted By nag_sathi
Hi pamu, Thanks a lot it working. Again...
Hi pamu,

Thanks a lot it working. Again Thanks a TON
1,622
Posted By nag_sathi
Hi Pamu, Yes all the values are taken to...
Hi Pamu,

Yes all the values are taken to line, i need to modify to lowercase of line, but if I modify set command giving diff results

I tried awk but throwing error

./secrdecode: line 23:...
1,622
Posted By nag_sathi
Upper to lower case in encoded file
Hi All,

I want to change the out put of a decode file from lower to upper. i used tr command but facing issue.

set -vx
id=$(id)
dt=$(date)
store=$1
if [[ $id = "uid=1200(raju) gid=220(raj)...
1,280
Posted By nag_sathi
Hi All, The issue happened due hashbang(#!)...
Hi All,

The issue happened due hashbang(#!) not defined at first line, now i modified and placed in first line. Its working in cron

Thanks.
Showing results 1 to 25 of 71

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