Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to use cut or sed for my little script. Post 302417324 by valiadi on Thursday 29th of April 2010 07:54:38 AM
Old 04-29-2010
Thank you for your interesnt in helping me, i have managed to solve it by myself. I will post that part for who needs it .
Code:
cat EXE_FILES_[$FIRSTPATH].txt > exe1.txt
cat EXE_FILES_[$SECONDPATH].txt > exe2.txt

echo "#!/bin/ksh" > files.txt

paste -d, exe1.txt exe2.txt | sed 's/,/ /g' > files.txt

rm -rf exe1.txt exe2.txt 

awk '{print "cmp " $0 }' files.txt > cmp.sh

rm -rf files.txt

chmod a+x cmp.sh

echo "Running CMP test..."

echo " "

./cmp.sh > results-cmp.txt

I'm sure that the code is not very "clean" but it works (thanks God) Smilie.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

cut vs. sed vs. awk ?

hi again...need new help guys:p the file contains following infos... users/abc/bla1.exe newusers/defgh/ik/albg2.exe users2/opww/ertz/qqwertzu/rwerwew.exe how to get the file content into... users/abc/ newusers/defgh/ik/ users2/opww/ertz/qqwertzu/ with... you can erase the... (5 Replies)
Discussion started by: svennie
5 Replies

2. Shell Programming and Scripting

SED and Cut question

I am trying to cut and delete using sed and redirect back into the file. This is not working write. When testing the script, it hangs. Any idea what I am doing wrong here. ################ Reads the input file to cut volumes for returns and CUT_ERVTAPE_FILE() { echo "working on cut... (2 Replies)
Discussion started by: gzs553
2 Replies

3. Shell Programming and Scripting

cut sed grep or other?

Hi Is there a way to cut the last two characters off a word or number given that this word or number can be of varying length? I have tried something like TEST=`echo $OLD | cut -c 1-5` where $OLD is a variable containing a number like 1234567 which gives a result of 12345. This is fine... (4 Replies)
Discussion started by: rleebife
4 Replies

4. Shell Programming and Scripting

Help in SED and CUT.

Hi I have a file. In Each and every line, i want to cut the position from 130 to 134 and need to check if it is XXXX then i need to replace with YYYY (Only from 130 to 134). Your help is very much appriciated. (4 Replies)
Discussion started by: senthil_is
4 Replies

5. Shell Programming and Scripting

cut in sed/awk

Hi Can i have an example where i should be able to cut columns (like for eg cut -c 1-3) in sed or awk. Regards Dhana (12 Replies)
Discussion started by: dhanamurthy
12 Replies

6. Shell Programming and Scripting

how to cut string with wildcard (sed)

i got text file and contain.... SKYPE Dec 11 09:26:05 IN=eth0 OUT=eth1 SRC=75.38.161.80 DST=192.168.1.56 PROTO=UDP SPT=30645 DPT=12630 LEN=66 SKYPE Dec 11 09:26:05 IN=eth1 OUT=eth0 SRC=192.168.1.56 DST=118.109.39.86 PROTO=UDP SPT=12630 DPT=15889 LEN=75 SKYPE Dec 11 09:26:05 IN=eth1 OUT=eth0... (2 Replies)
Discussion started by: slackman
2 Replies

7. Shell Programming and Scripting

sed cut columns

hello everyone ! i face the following problem as i use sed to ignore some columns of an output. the command i use is sed 's/^\(*\) \(*\).*/\1 \2/' as i only want the 2 first columns the command finger returns the problem is that for some lines the results are fine but for other lines... (8 Replies)
Discussion started by: vlm
8 Replies

8. Shell Programming and Scripting

sed should cut seconds

Hi! I need help to modify a comma-sep. file. I tried to cut the secons of a timestamp. ... 11,05/15/12,13:20:00,Raw Counts,58313,5280,6967 13,05/15/12,13:40:00,Raw Counts,70637,6592,8648 ... it should be: 11,05/15/12,13:20,Raw Counts,58313,5280,6967 13,05/15/12,13:40,Raw... (5 Replies)
Discussion started by: IMPe
5 Replies

9. Shell Programming and Scripting

Ping - cut and sed - problem

How can I get the following result of the "ping" command? Example: root@OpenWrt:~# ping google.com -c1 | sed -n 1p PING google.com (216.58.210.14): 56 data bytes How can I get the data only in the range of ()? The result of what I want to get it: 216.58.210.14 Please use code... (4 Replies)
Discussion started by: andrewxxx
4 Replies

10. Shell Programming and Scripting

Using :<<cut / cut to comment out block of bash script

I am using : << cut / cut to comment out block of code. Works fine on few lines of script, then it gives me this cryptic error when I try to comment out about 80 lines. The "warning " is at last line of script. done < results 169 echo "END read all positioning parameters" 170... (8 Replies)
Discussion started by: annacreek
8 Replies
filebyproc.d(1m)						   USER COMMANDS						  filebyproc.d(1m)

NAME
filebyproc.d - snoop opens by process name. Uses DTrace. SYNOPSIS
filebyproc.d DESCRIPTION
filebyproc.d is a DTrace OneLiner to print file pathnames as they are opened, including the name of the process calling the open. A line will be printed regardless of whether the open is actually successful or not. This is useful to learn which files applications are attempting to open, such as config files, database files, log files, etc. Docs/oneliners.txt and Docs/Examples/oneliners_examples.txt in the DTraceToolkit contain this as a oneliner that can be cut-n-paste to run. Since this uses DTrace, only users with root privileges can run this command. EXAMPLES
This prints new process name and pathnames until Ctrl-C is hit. # filebyproc.d FIELDS
CPU The CPU that recieved the event ID A DTrace probe ID for the event FUNCTION:NAME The DTrace probe name for the event remaining fields The first is the name of the process, the second is the file pathname. DOCUMENTATION
See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with ver- bose descriptions explaining the output. EXIT
filebyproc.d will run forever until Ctrl-C is hit. AUTHOR
Brendan Gregg [Sydney, Australia] SEE ALSO
opensnoop(1M), dtrace(1M), truss(1) version 1.00 May 15, 2005 filebyproc.d(1m)
All times are GMT -4. The time now is 05:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy