Shell code problems


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell code problems
# 1  
Old 12-17-2009
Shell code problems

So I have a line that is suppose to find all files in a folder and then run a program through all the files and then output the files with a _.txt ending.

Code:
find ./ -name '*' -exec sh -c 'intersect-by-ids -ff {} -fc 1 -if normed_occ.txt -ic 1 \> {}_.txt'\;

the error that i get is "find: missing argument to `-exec' "

so intersect by id is the program (it works cause I used it many times). I am trying to use the file normed_occ as a comparison file to all the files in the folder.

does anyone know what I am missing?
# 2  
Old 12-17-2009
I'd rather try to just -print instead of -exec and pipe it into xargs and see if that works better for you.
# 3  
Old 12-17-2009
Code:
find ./ -name '*' | while read -r KISS
do
    intersect-by-ids -ff "$KISS" -fc 1 -if normed_occ.txt -ic 1  "${KISS}_.txt"
done

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Two problems with my python code

Hello everyone , I need your help to end my python code. I've this code in python : from ipywidgets import interact, Dropdown from ipywidgets import * from ipywidgets.embed import embed_minimal_html import pandas as pd import os import sys #################### Dropdown servers... (1 Reply)
Discussion started by: Tim2424
1 Replies

2. What is on Your Mind?

Code learning problems

Now I suffer from my programming learning, feeling it is difficult, ask friends how I'm going to learn the code, I am doing penetration now, occasionally need to programming but suffer from themselves, to ask I hope to find a teacher :):) (2 Replies)
Discussion started by: planesb
2 Replies

3. UNIX for Dummies Questions & Answers

Code commenting Problems in shell scripting

Hi Friends, I Want to comment one line of code from below code. DBA_ORACLE_USER=`DB.sh -u -a User` DBA_ORACLE_PWORD=`DB.sh -p -a User` sqlplus /nolog <<-END > ${logfile} 2>&1 WHENEVER OSERROR EXIT 9 WHENEVER SQLERROR EXIT SQL.SQLCODE connect... (3 Replies)
Discussion started by: as234301
3 Replies

4. Programming

Problems compiling code

I am trying to compile some code and getting lot of errors g++ -traditional -Wno-non-template-friend -Wno-deprecated -O3 -DNDEBUG -DREAL=float -DGetREAL=Getfloat -IbaseLib -Itommy -Iothers ./source/main/RayTrac.cc -o raytrac ./source/main/RayTrac.cc:36:20: error: gendef.h: No such file or... (1 Reply)
Discussion started by: kristinu
1 Replies

5. Shell Programming and Scripting

Two problems when I am writing my own shell

Hi, guys: I am writing my own shell using c. I meet with two problems. First, when I use tcsetpgrp system call to move a background job to foreground, when this job finishes, my shell program also exit. What is the problem for that? Second, when I use signal , if the child has its own... (1 Reply)
Discussion started by: tomlee
1 Replies

6. UNIX for Dummies Questions & Answers

Problems in shell

hiiii this is the first time for me here >>> but really i have some problems for answers these things also understanding... Can any one help me? Write a simple shell as given in class. Your shell, called shell will read input lines from standard input, parse them into a... (3 Replies)
Discussion started by: Ronald kabbi
3 Replies

7. Shell Programming and Scripting

Shell variables problems

hi, i need some help, the situation is this 1-file of variable enviroments DIR1=/tmp DIR2=otherdir/mydir 2-file of list of files (all the names references whic variables of first point) ${DIR1}/${DIR2}/onefile Well now i create a shell script whic... (5 Replies)
Discussion started by: chipcmc
5 Replies

8. UNIX for Dummies Questions & Answers

Problems understanding example code

I am really new to UNIX and programming in general and so apologies if this thread is a bit simple. I have searched and found a piece of sample code for a training program I am currently undertaking, but seeing as I am relatively new, I dont completely understand how it works. Here is the... (6 Replies)
Discussion started by: Makaer
6 Replies

9. Shell Programming and Scripting

Problems understanding example code

I am really new to UNIX and programming in general and so apologies if this thread is a bit simple. I have searched and found a piece of sample code for a training program I am currently undertaking, but seeing as I am relatively new, I dont completely understand how it works. Here is the... (1 Reply)
Discussion started by: Makaer
1 Replies

10. Shell Programming and Scripting

C Shell problems

I am a newbies here and also dummies in csh language. I've been told from my frenz this forum is very useful site for Q&A about UNIX script. Can anyone in here just lead me to learn more about csh language with code example. tq (3 Replies)
Discussion started by: unknown2205
3 Replies
Login or Register to Ask a Question