Search Results

Search: Posts Made By: varathaneie
Forum: Linux 05-05-2016
3,295
Posted By varathaneie
Multiple process found when executed from script
Hi All,

I came across a weird scenario which i couldnt explain why.
As part of script which is run as /bin/sh shebang, we are trying to check if there is any process that runs with the same name...
2,143
Posted By varathaneie
I can give you an idea of how it can be done...
I can give you an idea of how it can be done assuming that you want to change some details on this specific line in the cron file of all 60 servers,

You can run the below commands with ssh,
1....
2,986
Posted By varathaneie
You can also try below, cat input.txt ...
You can also try below,


cat input.txt
1 3 4 5 6
3 6 7 8 3 5
2 3 5 6
2 3
1 4 5 6 8 9 9 4



split -l 2 -a 2 input.txt "Splitfile_"




Splitfile_aa
Splitfile_ab
Splitfile_ac
5,887
Posted By varathaneie
varathaneie: Please add relevant information here...
varathaneie: Please add relevant information here and not simply post links to other sites, especially with just a handful of posts here.
8,989
Posted By varathaneie

8,965
Posted By varathaneie
It was a good info which i never knew...Will try...
It was a good info which i never knew...Will try something on this...Thanks a lot :-)
6,584
Posted By varathaneie
Using awk
To get exact ouptu as you want with the the file name for which you are trying to get,


awk '{ line++; } END { print FILENAME" "line}' filename
8,965
Posted By varathaneie
How do i connect when i want to do automation...
How do i connect when i want to do automation which involves connecting from windows(win 7) to unix?

I believe FTP will not let us run any UNIX commands for our automation
2,051
Posted By varathaneie
Try this!!!
Assuming you have perl option,

ls *S1STC* | perl -nle '$x=$_;s/S1STC/S2STC/;system "cp $x $_"'

Or if you want a looping structure, use below code,

#!/bin/sh
for foobar in `ls *S1STC*`;...
1,736
Posted By varathaneie
Remove the break
Hi Nawrajesh,

Try to remove the below lines from your code


exit ;
break;;


and replace it with

echo "End of Seclection" ;;

It worked fine for me while testing.
13,863
Posted By varathaneie
Another way
var=`ls -d */*.o | grep -v vwin`

Now var has the value of all the *.o files
72,739
Posted By varathaneie
Using Sed
Try the below command

sed -n 's/<Key>\(.*\)<\/Key>/\1/p' filename
1,750
Posted By varathaneie
Direct command
For long listing
ls -lrt *PROMOTION* | grep -v LEN

For just FIlename
ls *PROMOTION* | grep -v LEN
1,551
Posted By varathaneie
Hi Pravin, Is it possible for you to...
Hi Pravin,

Is it possible for you to explain the awk commadn which u have provided...
3,031
Posted By varathaneie
Shorter
If in case you want to get only the top 10 directories in the current directory, you can try below command,

du /usr/ | sort -rn | awk 'NR>=2&&NR<=10 { print $2"\t" $1 }'
1,541
Posted By varathaneie
try this....
if u want to work with all the files in the current directory, you may to use a looping structure,
ls > ./list.txt
while read line
do
sed "/#Text_to_be_deleted/d" $line >tmp
mv tmp $line...
1,555
Posted By varathaneie
same output but easy command
Hope this also gives the same output which is easier to understand,

echo "datarecords.txt: male | datarecords.txt: male | datarecords.txt: female" | sed 's/datarecords.txt//g'
Showing results 1 to 17 of 17

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