Sponsored Content
Top Forums Shell Programming and Scripting Query on (standard input) messages being issued by script Post 302903521 by neilrhysjenkins on Wednesday 28th of May 2014 07:25:12 AM
Old 05-28-2014
Query on (standard input) messages being issued by script

Hi.

I'm working in an IBM mainframe UNIX environment and am running a script as follows:
Code:
for i in `find . -name *.xml -type f`
do
test -f $i && iconv -f IBM-932 -t IBM-1047 $i | egrep -l $1 && echo $1" found i
n" $i "searching as ASCII"
done

The idea is to locate all *.xml files beneath where I happen to be in the directory structure, convert then from ASCII to EBCDIC (necessary as egrep works on ebcdic files on the IBM mainframe platform) and then search for a particular string in them. If found then issue a message indicating that the string was found in the ascii file.

When I run it I see output like this:
Code:
(JENKINN-TAOS)/software/wasv6Config/W5Q/AsrvW5QE/profiles/default/config >~/nrjscan2 bam146dev
(standard input)
bam146dev found in ./cells/W5QdevUIMX/nodegroups/DefaultNodeGroup/nodegroup.xml searching as ASCII
(standard input)
bam146dev found in ./cells/W5QdevUIMX/nodes/W5QE/serverindex.xml searching as ASCII
(standard input)
bam146dev found in ./cells/W5QdevUIMX/nodes/W5QEDM/serverindex.xml searching as ASCII
(standard input)
bam146dev found in ./cells/W5QdevUIMX/nodes/W5QF/serverindex.xml searching as ASCII
(standard input)
bam146dev found in ./cells/W5QdevUIMX/security.xml searching as ASCII
(standard input)
bam146dev found in ./cells/W5QdevUIMX/virtualhosts.xml searching as ASCII
(JENKINN-TAOS)/software/wasv6Config/W5Q/AsrvW5QE/profiles/default/config >

Does anyone know why I'm getting the (standard input) between each of the lines being echo'd following a successful find ?

Thanks,
Neil.


Moderator's Comments:
Mod Comment Please use code tags next time for your code and data. Thanks

Last edited by vbe; 05-28-2014 at 08:53 AM.. Reason: code tags...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

standard input

how can i redirect standard input? i dont remember :/, though could you redirec not from a command? i mean, to redirect always stdin and stout (1 Reply)
Discussion started by: Jariya
1 Replies

2. Shell Programming and Scripting

How to copy from standard input

I tried copy the output files from find command into a directory. Example, find / -name core 2>/dev/null | xargs cp???? I have known that we can use xargs to execute command lines from standard input but how to use it in this case. Or I can do something besides xargs. (2 Replies)
Discussion started by: lalelle
2 Replies

3. Shell Programming and Scripting

change standard input ?

Dear... I have a scrpit that contains multiple read command.... when I run the script I have to enter 3 variables so that I can get the output.. but, I dont want to put those 3 inputs manually every time... I want to make a shell that reads the 3 inputs from a file. the script name is... (4 Replies)
Discussion started by: yahyaaa
4 Replies

4. Solaris

standard input

Please give me any example for standard input in Solaris. (6 Replies)
Discussion started by: karman0931
6 Replies

5. Shell Programming and Scripting

Unix Shell scripting -How to skip User Standard input section from another script

All, problem Description: For example: I have two shell scripts(executables). let name it as script1 and script2.I'm trying to execute script1 from script2. while executing script2, script1 is asking for manual input(input from keyboard). Now i need to know how I can skip this user input... (3 Replies)
Discussion started by: techie99
3 Replies

6. Shell Programming and Scripting

Reading Standard Input

Hello, I am new to scripting. How do I read multiple lines from the command line? I know read reads one line, but if I have to read multiple lines, how should I do? Thanks, Prasanna (4 Replies)
Discussion started by: prasanna1157
4 Replies

7. Shell Programming and Scripting

Reading from standard input

So, I am new to shell scripting and have a few problems. I know how to read from standard input but I do not know how to really compare it to say, a character. I am trying to compare it to a character and anything exceeding just a character, the user will get an output message, but the program... (7 Replies)
Discussion started by: Bungkai
7 Replies

8. Shell Programming and Scripting

Need help to run sql query from a script..which takes input from a file

I need to run sql script from shell script which takes the input from a file and contents of file will be like : 12345 34567 78657 and query will be like : select seq_nbr from bus_event where event_nbr='12345'; select seq_nbr from bus_event where event_nbr='34567'; select seq_nbr... (1 Reply)
Discussion started by: rkrish
1 Replies

9. Shell Programming and Scripting

Shell Script to execute Oracle query taking input from a file to form query

Hi, I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database. For instance: USER CITY --------- ---------- A CITY_A B CITY_B C ... (2 Replies)
Discussion started by: DevendraG
2 Replies

10. Homework & Coursework Questions

Removing punctuations from file input or standard input

Just started learning Unix and received my first assignment recently. We haven't learned many commands and honestly, I'm stumped. I'd like to receive assistance/guidance/hints. 1. The problem statement, all variables and given/known data: How do I write a shell script that takes in a file or... (4 Replies)
Discussion started by: fozilla
4 Replies
TR(1)							      General Commands Manual							     TR(1)

NAME
tr - translate characters SYNOPSIS
tr [ -cds ] [ string1 [ string2 ] ] DESCRIPTION
Tr copies the standard input to the standard output with substitution or deletion of selected characters. Input characters found in string1 are mapped into the corresponding characters of string2. When string2 is short it is padded to the length of string1 by duplicat- ing its last character. Any combination of the options -cds may be used: -c complements the set of characters in string1 with respect to the universe of characters whose ASCII codes are 01 through 0377 octal; -d deletes all input characters in string1; -s squeezes all strings of repeated output characters that are in string2 to single characters. In either string the notation a-b means a range of characters from a to b in increasing ASCII order. The character `' followed by 1, 2 or 3 octal digits stands for the character whose ASCII code is given by those digits. A `' followed by any other character stands for that character. The following example creates a list of all the words in `file1' one per line in `file2', where a word is taken to be a maximal string of alphabetics. The second string is quoted to protect `' from the Shell. 012 is the ASCII code for newline. tr -cs A-Za-z '12' <file1 >file2 SEE ALSO
ed(1), ascii(7) BUGS
Won't handle ASCII NUL in string1 or string2; always deletes NUL from input. TR(1)
All times are GMT -4. The time now is 04:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy