[Solved] basic script help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting [Solved] basic script help
# 1  
Old 10-24-2011
[Solved] basic script help

I run a command to extract blob file locations in a large log file to another file to remove all the fluff.

Example:
Code:
[root] # tail -50 samtest|grep -i blob|cut -d "'" -f 2
/ASM/archive/20100311/18a7e13f.blob
/ASM/archive/20100312/18b5570b.blob
[root] # cat outtest.log
/ASM/archive/20100311/18a7e13f.blob
/ASM/archive/20100312/18b5570b.blob

I want to automatically delete the files generated by these commands. Is there a way to script this?

Thanks.


Moderator's Comments:
Mod Comment Video tutorial on how to use code tags in The UNIX and Linux Forums.

Last edited by Franklin52; 10-25-2011 at 04:19 AM.. Reason: Please use code tags, thank you
# 2  
Old 10-24-2011
following your command:
Code:
tail -50 samtest|grep -i blob|cut -d "'" -f 2 |xargs rm

# 3  
Old 10-25-2011
Worked perfectly, muchos gracias
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need a little help with my first shell script. Basic image resize script...

Hey everyone, just now joined because I didn't want to go onto Ubuntu forums and start asking about how to write shell scripts. Seems like this is a pretty active forum for exactly what I need. I'm trying to modify a shell script I found online, the end goal is to have it find all files in the... (9 Replies)
Discussion started by: mozzles
9 Replies

2. UNIX for Dummies Questions & Answers

Help with basic script - not working..

Here is the script I wrote... Pls. help. #!/bin/ksh for SERVER in NEWSNYD403P NEWSNYD404P SNEWSNYD601P SNEWSNYD602P SNEWSDNY603P SNEWSNYD604P do /usr/bin/scp "/home/sam/bash.tar root@$SERVER":/tmp done Error msg I get: ./scp_script.sh: syntax error at line 3:... (2 Replies)
Discussion started by: samnyc
2 Replies

3. UNIX for Dummies Questions & Answers

Basic Question on perl use POSIX [SOLVED]

Hi guys, I think this is a basic question. I'm not very familiar with this. I'm trying to round a number up and round a number down. From what I have read this can be done using POSIX. I have tried to to use this, but i'm getting errors: sub findGridBounds($$$%) { use POSIX; ... (0 Replies)
Discussion started by: WongSifu
0 Replies

4. Shell Programming and Scripting

Basic Shell Script Help

Lets say I wanted to create a script that would show what people are doing on my machine using the w command and refresh in about 6 seconds. What would be the easiest way to do this? I pretty much want the script to loop until I stop it. I'm using the BASH shell by the way. Help is appreciated.... (1 Reply)
Discussion started by: c4391
1 Replies

5. Shell Programming and Scripting

create a basic script

Hi everybody :( :confused: :D, I need someone to help me! I have a file with 4 colunms and I would like to transform only the 4th colunm by multiplying this by a constant value (i.e 0.3047). I'm a new one using/creating basic scripts and I'm using linux redhat. The file has the following... (1 Reply)
Discussion started by: Estanislau
1 Replies

6. Shell Programming and Scripting

I need help with a basic script

a) Total number of words in the file. b) Total number of different words in the file. How can I use the translate and/or unique commands to accomplish this (4 Replies)
Discussion started by: EECSDAVE
4 Replies

7. Shell Programming and Scripting

Basic script?

All, I have a list of over 400 users that need certain directories created. These will be created in /users/$username on a system and I need a directory called chess under these directories that I create. Instead of me manually adding each one (mkdir /users/user1, mkdir /users/user1/chess)... (1 Reply)
Discussion started by: kjbaumann
1 Replies

8. UNIX for Dummies Questions & Answers

Need help with basic unix script

What I am supposed to do is creat a menu with the following Find a song Find a album Sort by artist Delete a song Add a new song Quit Now the file with the song information is database Here is what I have so far #!/bin/bash #================================================= #Script Name:... (1 Reply)
Discussion started by: stp0052
1 Replies
Login or Register to Ask a Question