How to eliminate < > sign meaning


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to eliminate < > sign meaning
# 1  
Old 09-01-2009
How to eliminate < > sign meaning

Hi

I would like to replace one of our script, and add some pre-checking for the input file before running the command, but I bumped into the following issue:

Original command: use < input.txt

I cannot modify the original command, but I created the useit script which would be called as an alias called use, so it would have a priority before the original command. I would like to check the content of the input.txt file, and still keep the original syntax of the command:

so basically it would be: useit < input.txt

The problem is, that in the useit command I cannot call the parameters after the redirection (<). Is it possible to eliminate the meaning of < and handle it as a string after the useit command, so I could refer to the input.txt file as a parameter?
# 2  
Old 09-01-2009
I don't understand. Can you not write a wrapper script. -- do your preprocessing
on the file, then call the other script
Code:
while read record
do
 # do stuff with each record here.
done < somefile.txt > input.txt
otherscript.sh

# 3  
Old 09-01-2009
Can you wrap the original script in quotation marks and then pass that to the new command?
Code:
newcommand "use < input.txt"

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Eliminate comma on Field

Hi All, Seeking for your assistance on my problem below: What i did was extract the records from database and change the extension name to .csv. My problem is there is a records contains comma between records if i opened it in excel it will generate the comma as new field(please see below... (6 Replies)
Discussion started by: znesotomayor
6 Replies

2. Shell Programming and Scripting

Need help to eliminate the records

Hi All, Please help me how to remove the records from the file if it is having more number of fields than the required one, before loading into stage Here is the sample records. File is space delimited one chandu 1121324 CC ( 2 spaces) chandu balu 434657 DD (3 spaces) -- failing due to... (10 Replies)
Discussion started by: bbc17484
10 Replies

3. Shell Programming and Scripting

How to eliminate ^L

Hi, I am trying to create a text file from data retrieved from a query.The data retrieved is having this character '^L' at regular intervals of the data. How can i eliminate this, Please find below the sample data. I tried sed -e "s/\^L//g" to convert it, but with no luck ^LCODE*SERIAL... (11 Replies)
Discussion started by: ramkiran77
11 Replies

4. Shell Programming and Scripting

Compare and eliminate

Could any one help me to compare the date value say at 10th column with sysdate (i.e current date) and if diffrence is more than 50 days then filter them out from the file. The file contain 10000 records. head file 00971502657744 A671FAHP2EW8BG1369172011HRWS contact information ... (6 Replies)
Discussion started by: zooby
6 Replies

5. UNIX for Dummies Questions & Answers

How to eliminate wrapped lines

I have a file abc: line 1 line 2 line 3 line 4 And I am successfully e-mailing the file, with this: mail -s "contents of abc" jdoe@email.com <<EOF cat abc EOF But the e-mail shows up looking like this: subject: contents of abc line 1 line 2 line 3 line 4 The carriage returns... (5 Replies)
Discussion started by: tumblez
5 Replies

6. Shell Programming and Scripting

How to eliminate inf value in AWK

Hi, I have the calculations which return me infinity (inf), -inf, other very larger number when I printed them out. I did try to insert some control condition not to print these out if the above condition is met. The code I implemented is something like:- for (i=0;i<=1000;i++){ ... (3 Replies)
Discussion started by: ahjiefreak
3 Replies

7. UNIX for Dummies Questions & Answers

Help to eliminate a warning message

Hi all, I'm trying to run this command in a script: utenti_conn=`ssh $MYUSER@$MYTRAP01IP sudo cat /opt/accenture/trapwriter/data/TMDVOD\-1\-\`date \+\%Y\%m\%d\`\* /opt/accenture/trapwriter/data/TMDBTV\-1\-\`date \+\%Y\%m\%d\`\*|awk -F'|' '{print $7}'|sort |uniq|wc -l` and in output I... (1 Reply)
Discussion started by: idro
1 Replies

8. Shell Programming and Scripting

Sign on/Sign off logging script

I'd like to make a script that I can execute every time I sign on to my linux box that keeps track of the time and allows to me to add a remark to a file. So basically once I log in, I run the script, and it outputs the date and time to a text file (log.txt). But that isn't my problem. I need... (1 Reply)
Discussion started by: Glider
1 Replies

9. Shell Programming and Scripting

Meaning of % sign

Does % sign have any impact, special meaning in unix shell scripts ??? (2 Replies)
Discussion started by: sokash
2 Replies

10. UNIX for Dummies Questions & Answers

boot messages - how to eliminate them

Anyone would know how to get rid off a message that comes up during a boot-up on Solaris? It says that the clusters for this software are not installed. I deleted the software because it was crashing some other stuff but it did not get rid off all the stuff. Yes, I am coming from windows and... (2 Replies)
Discussion started by: softarch
2 Replies
Login or Register to Ask a Question