Search Results

Search: Posts Made By: Devendra Hupri
1,352
Posted By Devendra Hupri
Remote file transfer between Linux and Windows
Hello,

I have a file, say details.txt on my windows machine. I want to copy it to linux machine through a shell script and edit the file and transfer the file back to windows machine. (All I want...
971
Posted By Devendra Hupri
sed 's/\/cts\//\//g' filename
sed 's/\/cts\//\//g' filename
1,444
Posted By Devendra Hupri
Hello Revinder, Thank you, your following...
Hello Revinder,

Thank you, your following code worked for me.

awk '{for(i=1;i<=NF;i++){if(i%2==0){A[j]=A[j]>$i?A[j]:$i} if(i%2!=0){j=$i}}} END{for(u in A){B=B>A[u]?B:A[u]};print B}' Input_file
1,444
Posted By Devendra Hupri
Hey Ravinder, your code didn't give the...
Hey Ravinder,

your code didn't give the expected result,
Expected output is : only "5"
what it gave is:

2015-01-29-05-38-02 5
2015-01-29-05-38-03 5
2015-01-29-05-37-50 5...
1,444
Posted By Devendra Hupri
hey anbu23, I need max(X) irrespective of...
hey anbu23,

I need max(X) irrespective of Timestamp.

Thank you.
1,444
Posted By Devendra Hupri
Maximum of the values from the output a query
Following is the output of a command ran inside the script:
2015-01-29-05-38-02 5 2015-01-29-05-38-02 5 2015-01-29-05-38-02 5 2015-01-29-05-38-02 5 2015-01-29-05-38-02 5 2015-01-29-05-38-03 5...
1,741
Posted By Devendra Hupri
Getopts
while getopts v OPTION
do
case $OPTION in
v) echo "Hello" ;;
*) exit 1;;
esac
done
Suppose I have script tmp.sh
Whose Signature is tmp.sh <fixed_argument> [-v]
...
5,361
Posted By Devendra Hupri
Hey Ravinder, This Code worked.. Thank...
Hey Ravinder,

This Code worked..

Thank you :-)
5,361
Posted By Devendra Hupri
Hey, Ravinder, Your code given in #5 is...
Hey, Ravinder,

Your code given in #5 is working when i run it from the same directory where the subdirs are present but It won't work from any other dirs outside.

Thank you.
5,361
Posted By Devendra Hupri
Yes Don, The second suggestion given by...
Yes Don, The second suggestion given by MadeInGermany worked for me.

Thank you for sharing the solution.
5,361
Posted By Devendra Hupri
Hello Mr.Cragun, When I tried rm -rf `ls -t...
Hello Mr.Cragun,

When I tried rm -rf `ls -t $TGTDIR | awk 'NR>5'` from any other directory, It was unable to delete, exited normally, without yielding any ,messages with 0 status.

But when I...
5,361
Posted By Devendra Hupri
Hey MadeInGermeny, Thanks, The code worked. ...
Hey MadeInGermeny,

Thanks, The code worked.

---------- Post updated at 12:30 PM ---------- Previous update was at 12:28 PM ----------

Hello Mr. Cragun,

I'm using bash shell.
It did not...
5,361
Posted By Devendra Hupri
Hey Cragon, I have Linux machine. TGTDIR...
Hey Cragon,

I have Linux machine.
TGTDIR conatains no non-directory files.
There are no naming mistakes.

I have a directory which contains the subdirs only. these subdirs are created as a...
5,361
Posted By Devendra Hupri
Hey Ravinder, No need to check the dir...
Hey Ravinder,

No need to check the dir contents, I just need to retain latest five removing the old ones.
The dirs are not empty. they contain some data.
5,361
Posted By Devendra Hupri
Thanks RavinderSingh13...
Thanks RavinderSingh13 (https://www.unix.com/members/302148617.html), The first code worked,
I had 7 subdirs, it only listed 1(which was old) it was expected to report 2 old dirs
5,361
Posted By Devendra Hupri
Remove all the subdirectories except latest 5 inside any given directory
I Want to remove all the sub-directories except latest five in any given TGTDIR.
Is there a way to do so without making a cd to TGTDIR?
I have tried the following but not worked.
Thank you.

rm...
Showing results 1 to 16 of 16

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