Creating Job List: Print error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Creating Job List: Print error
# 1  
Old 07-21-2008
Creating Job List: Print error

I have a very simple script here who's output is supposed to be a text file containing the same command applied to different files. Here it is:

#!/bin/bash
for f1 in newEN*bloc
do
cd ./$f1
for f2 in *.maf
do
awk '{print '"run_lrt.sh /home/awknerd/idea/TEST/$f1/$f2"'}' > /home/awknerd/idea/TEST/mylist.txt
done
cd ..
done


Desired Output:

run_lrt.sh /home/awknerd/idea/TEST/valueoff1/valueoff2


And this line over and over until it reads all values of f1 and f2.

Let's say the value of f2 is worst.maf. I keep getting a syntax error on every line pointing to the ".sh" in "run_lrt.sh" and the ".maf" in the value of file f2. How am I misusing the print command here? Any help would be greatly appreciated. THanks!
# 2  
Old 07-23-2008
You're misusing quotes rather than the print command, try this:

Code:
awk 'BEGIN{print "run_lrt.sh /home/awknerd/idea/TEST/'$f1/$f2'"}' > /home/awknerd/idea/TEST/mylist.txt

ETA: Need a BEGIN clause to run your code as you are not supplying any input file or stdin.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating script with multiple job arrays

Hello everyone, First of all this is my first post and im fairly new to working with Unix and creating scripts etc. so there will probably be wrong phrases used. Lets get to my questions. I have multiple scripts that submit Slurms/Jobs to the cluster starting like this and doing certain... (3 Replies)
Discussion started by: idbemad
3 Replies

2. UNIX for Dummies Questions & Answers

Creating a column based list from a string list

I have a string containing fields separated by space Example set sr="Fred Ted Joe Peter Paul Jean Chris Tim Tex" and want to display it in a column format, for example to a maximum of a window of 100 characters And hopefully display some thing like Fred Ted Joe ... (3 Replies)
Discussion started by: kristinu
3 Replies

3. UNIX for Dummies Questions & Answers

Help Creating Daily Cron Job

I need to create a cron job that will run daily to change permissions to a particular folder to 666 every 24hrs. I have no experience with crontab or cron jobs at all so if someone can guide me through this it would be a great help. The folder's example is 'www/test/htdocs' Also if you... (3 Replies)
Discussion started by: Xechno
3 Replies

4. UNIX for Dummies Questions & Answers

print job seperator page

How do I get my linux login ID to print on seperator page on print jobs. Right now it prints " Remote User" thanks Jim (0 Replies)
Discussion started by: jdmowrer
0 Replies

5. AIX

Print job to file

Anyone know of a way to do this? :confused: (1 Reply)
Discussion started by: eley
1 Replies

6. Linux

Need Help with creating a Cron Job

Hello Guys. I really need some help creating a cron job. I want to back up my mySQL database, which runs a phpBB Forum. I need the backup to run every 6 hours - but the host can make it run every 6 hours. I need it to backup to a directory called Backups (on the root) and i dont want it... (1 Reply)
Discussion started by: dhoodle
1 Replies

7. OS X (Apple)

Get print job information

Hi all, I am on a mac and I am trying to get more information about print jobs i have. "lpq" only displays the document printing, size, and job ID. I need the status (if its on hold or not). Anyway to do that in unix/cups? (5 Replies)
Discussion started by: CBarraford
5 Replies

8. UNIX for Dummies Questions & Answers

How can I print multiple files in one job?

Does anybody know how I can print multiple files in one print job? This is what I am doing currently: enscript file1 file2 file3 sent to printer sent to printer sent to printer I would like it to print like this: enscript file1 file2 file3 sent to printer The current behavior... (2 Replies)
Discussion started by: GregoryPeck
2 Replies

9. UNIX for Dummies Questions & Answers

FTP a print job that's still in queue?

I have an HP-UX system that has remote print queues created on it. We're having trouble with the data so I stopped the queue from sending its data to the recieving server. I typed "lpstat -o<queue> " and I see two print jobs listed c_91428.1 and c_91429.1 but when I go to the /usr/spool/<queue>... (2 Replies)
Discussion started by: HVHS_CJR
2 Replies

10. UNIX for Dummies Questions & Answers

Problem deleting print job

I am running SCO OpenServer Release 5 and I had a problem with a print job and I cancelled it. The print job still shows under lpstat as cancelled but doesn't go away and now I everything I print to the printer stays in the queue, but doesn't print. I have tried to delete the print job in... (2 Replies)
Discussion started by: sgtdmc
2 Replies
Login or Register to Ask a Question