10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
-bash-4.1$ hdfs dfs -ls -R /data/backup/prd/xyz/ | grep '^d'
drwxr-xr-x - abisox abadmgrp 0 2018-05-05 01:03 /data/backup/prd/xyz/20180301
drwxr-xr-x - abisox abadmgrp 0 2018-05-05 01:03 /data/backup/prd/xyz/20180302
drwxr-xr-x - abisox abadmgrp 0 2018-05-05 01:03... (2 Replies)
Discussion started by: himanshupant
2 Replies
2. Shell Programming and Scripting
Hi I have some script like this:
perl -i -p0e 's/"keyword1-.*?"/"keyword2"/s' file
to replace some keyword, but it replaces only the first instance of the keyword
how can i get it to replace all instances?
thanks! (2 Replies)
Discussion started by: vanessafan99
2 Replies
3. Shell Programming and Scripting
Hi I have a file with following records
It contains three months of data, some data is duplicated,i need to access the latest data from the duplicate ones.
for e.g; i have foll data
"200","0","","11722","-63","","","","11722","JUL","09"
"200","0","","11722","-63","","","","11722","JUL","09"... (10 Replies)
Discussion started by: vee_789
10 Replies
4. UNIX for Dummies Questions & Answers
In my command prompt I did:
sed 's/\://' mytextfile > newtextfile
But it only deleted the first instance of : in each line when some lines have multiple : appearing in each one. How can I delete all the : from the entire file? (1 Reply)
Discussion started by: guitarscn
1 Replies
5. Shell Programming and Scripting
I've got a web access file that I want to grep (or awk or perl or whatever will work!) out the most frequent instances of unique IP entries. Meaning the file looks something like this:
I'd like to run a sort or grep (or whatever) that will only select out the lines from IP's that had the... (7 Replies)
Discussion started by: kevinmccallum
7 Replies
6. Shell Programming and Scripting
Hi experts,
I am new to scripting. I have a requirement as below.
File1:
A|123|NAME1
A|123|NAME2
B|123|NAME3
File2:
C|123|NAME4
C|123|NAME5
D|123|NAME6
1) I have 2 merge both the files.
2) need to do a sort ( key fields are first and second field)
3) remove all the instances... (3 Replies)
Discussion started by: vukkusila
3 Replies
7. Shell Programming and Scripting
I know this should be simple but the periods in the string replacement are throwing me off.
What I want to do is replace 1.1.1.1 in my access.log file with 2.2.2.2
I have tried using 'tr' but its being thrown off by the periods and replacing all sorts of stuff in the file.
What do I need... (2 Replies)
Discussion started by: LordJezo
2 Replies
8. UNIX for Dummies Questions & Answers
KSH - I've got a script that is generating a number of log files like this:
y=`date +"%y"`
m=`date +"%m"`
$LOG_DIR/tuscprof_tbl_$y$m.log
I only want to keep the current 2 months' worth of files (current month and prior month). So I'm trying to come up with a way to delete any that... (1 Reply)
Discussion started by: dstinsman
1 Replies
9. UNIX for Dummies Questions & Answers
I am capturing text based reports with a specific program, which works no problem. However, since I send report warehouse output as they are migrated from the database software, on occasion when two capture process' initiate simultaneously, the capture file locks up. Is there a way to setup (in... (1 Reply)
Discussion started by: gozer13
1 Replies
10. Shell Programming and Scripting
i want to delete files that are one day old
condition is files should be of current month only ie if iam running script on 1 march it should not delete files of 28 feb(29 if leap year :-)}
any modifications to
find $DIR -type f -atime +1 -exec rm -f{}\; (4 Replies)
Discussion started by: maverick
4 Replies