Sponsored Content
Full Discussion: scan and edit in bash
Top Forums Shell Programming and Scripting scan and edit in bash Post 302674353 by aster007 on Thursday 19th of July 2012 12:21:36 PM
Old 07-19-2012
Quote:
Originally Posted by Jaymz
file looks like this:

some line
comment1 C:\blabla\more blahblah\myfile1
comment2 C:\blabla\more blahblah\myfile2
some other line

and I need it to only show:

some line
comment1 myfile1
comment2 myfile2
some other line

---------- Post updated at 11:14 AM ---------- Previous update was at 10:57 AM ----------



I get this error:
syntax error at line 19: `end of file' unexpected

corrected the cp statement.
Also, use this for getting the second part

Code:
cat $FILE_NAME | grep "C:\" | awk '{print $2}' > absolute_paths.dat

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

IP Name scan

Hi. how to search a range of IP:s for their registed IP names? Like nslookup or host for all IPs 130.xxx.xxx.1 to 130.xxx.xxx.254 //nicke (2 Replies)
Discussion started by: nicke30
2 Replies

2. Red Hat

how to edit the bash shell?

Hello friends, I want to add some features to the bash shell.I logged in as the root.Even then could not view the source code of bash shell in RH 9,Fedora 8.It is in encrypted form.Can you please tell me how to include my code into bash shell. Please give me a sample code so that I can understand... (3 Replies)
Discussion started by: nsharath
3 Replies

3. Shell Programming and Scripting

In bash, read to a variable with a default value to edit

My script needs to read a variable from the user. But before the user types the input, I want to give a default value so the user can edit the default value for input. How can I implement it? My script is something like: #!/bin/sh read -p 'Port number: ' -e port_number echo "Port... (7 Replies)
Discussion started by: pankai
7 Replies

4. UNIX Desktop Questions & Answers

grub, ok, bash, edit, kmdb and what else?

Hello There is a > prompt at Grub, # prompt for the console and $ for bash, but I am clueless about when and how to get into a specific prompt, how to move around between one prompt to another and how to exit. Is there a very basic guide anywhere that CLEARLY explains the type of shell... (2 Replies)
Discussion started by: mani1413
2 Replies

5. Shell Programming and Scripting

Edit csv file with bash

I' trying to use bash to edit a csv file from this format: "apples","oranges","grapes" "bread","butter","milk" To this: "apples oranges grapes" So that if I would open the csv file in open office, "apples oranges grapes" Would be in one single cell, and "bread (2 Replies)
Discussion started by: locoroco
2 Replies

6. UNIX for Dummies Questions & Answers

best way to scan?

i want to scan all open and closed ports on a server. how can i do this. i intend on using nmap, but if there are better ways to do it, please let me know. i understand there are a total of 6335 allowable ports on a server. so out of that 6335, i want to know which is open or closed. id... (1 Reply)
Discussion started by: SkySmart
1 Replies

7. Shell Programming and Scripting

Plus edit and edit header

Dear Masters, i have a problem with unix script, till now i just know about how to create header. i want to change file below -63395.2 72653.5 -63361.3 72696.0 ... (9 Replies)
Discussion started by: ipatah
9 Replies

8. Shell Programming and Scripting

Bash script - add/edit to file and save - sed?

I'm working on a script to execute a number of items. One being, editing particular files to add certain lines. I'm attempting to utilize sed, but, having issues when running from a bash script. Assistance is greatly appreciated. My example: sed -i '14 i\ # add these lines add these lines to... (5 Replies)
Discussion started by: Nvizn
5 Replies

9. Shell Programming and Scripting

Create automated scan of specific directory using bash

I am trying to use bash to automate the scan of a specific directory using clamav. Having this in place is a network requirement. The below is an attempt to: 1. count the extensions (.txt, .jpeg) in a directory and write them to a virus-scan.log (section in bold) 2. scan each folder in the... (6 Replies)
Discussion started by: cmccabe
6 Replies

10. Shell Programming and Scripting

Scan and remove if file infected using bash

The below bash runs clamav on all files in DIR and produces virus-scan.log. My question is the portion in bold is supposed to move the infected files, lines not OK, to /home/cmccabe/quarantine. Does the bash look correct? Thank you :). virus-scan.log Mon Jan 16 14:39:05 CST 2017... (5 Replies)
Discussion started by: cmccabe
5 Replies
OGGCAT(1)							   User Manuals 							 OGGCAT(1)

NAME
oggCat - concatenates two ogg video files (.ogv, .ogg or oga) SYNOPSIS
oggCat [options] outfile.ogv file1.ogv file2.ogv [ file3.ogv [...] ] DESCRIPTION
oggCat concatenates two or more ogg files. The parameters of the resulting ogg file is defined by the first file in the concatenation list. The parameters could be changed by some options, explained below. All subsequent files that does not match these video file parameters are automatically transcoded. A concatenation will fail in case that there are not enought streams available. This could happen e.g. if the first file consists of one audio and one video stream and the second file only carries a video stream. If there is more than one video or audio stream within the file, the first stream is used. OPTIONS
-s Sets the size of the video frame. The size is given as <width>x<height>. At default, the video frame size is the size of the first video stream. Example: -s 320x240 -d Sets the datarate in byte per seconds for the video encoder (theora). This meant to be a upper threshold. So the file may be smaller than assumed. If not set, the datarate of the first file is used. Example: -d 1024000 -D Sets the datarate in byte per seconds for the audio encoder (vorbis). If not set, the datarate of the first file is used. Example: -D 64000 -f Sets the frame rate of the video with numinator and demoninator and is the pictures per second. If only one number is given, the denominator is set to 1. If not set, the framerate of the first file is used. Example: -f 25:2 -F Sets the sample frequency (sample rate) of the audio data in Hertz. If the sample frequency does not match the one with the original file, resamling is invoked. Example: -F 32000 -c Adds comments to the video (theora) stream. Comments are given by a pair of type and value in the form 'type=value'. More than one comment can be concatenated with a semicolon. It is recommended to use apostrophes as the command line may use the semicolon as a seperator. Example: -c 'AUTHOR=yorn;DATE=03.07.09' -C Adds comments to the audio (vorbis) stream. Comments are given by a pair of type and value in the form 'type=value'. More than one comment can be concatenated with a semicolon. It is recommended to use apostrophes as the command line may use the semicolon as a seperator. Example: -C 'AUTHOR=yorn;DATE=03.07.09' -q Specifies the video quality for the newly created stream. Valid values can be chosen between 0 and 63 (best). Example: -q 63 -rv Force to reencode the video stream. This is sometimes neccessary, if the video stream match in video parameters, but not in the the- ora version. In that case, reencoding the video stream helps creating good results. -x Force to overwrite the output file, even if it exists. This is mainly helpful if the oggCat is server controlled. EXAMPLES
oggCat concatFile.ogv myfile1.ogv myfile2.ogv myfile3.ogv or oggCat -o concatFile.ogv myfile1.ogv myfile2.ogv myfile3.ogv This command creates a cancatenated file concatFile.ogv that consists of the three files myfile1.ogv myfile2.ogv myfile3.ogv oggCat -s320x240 -q63 concatFile.ogv myfile1.ogv myfile2.ogv myfile3.ogv This command connects the three files myfile[1-3].ogv to file concatFile.ogv with the size of 320x240 and best quality. AUTHOR
Joern Seger <yorn at gmx dot net> SEE ALSO
oggCut(1), oggJoin(1), oggSplit(1), oggTranscode(1), oggSlideshow(1), oggThumb(1), oggSilence(1) Linux JAN 2010 OGGCAT(1)
All times are GMT -4. The time now is 01:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy