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
service(8)						      System Manager's Manual							service(8)

NAME
service - run a System V init script SYNOPSIS
service SCRIPT COMMAND [OPTIONS] service --status-all service --help | -h | --version DESCRIPTION
service runs a System V init script in as predictable environment as possible, removing most environment variables and with current working directory set to /. The SCRIPT parameter specifies a System V init script, located in /etc/init.d/SCRIPT. The supported values of COMMAND depend on the invoked script, service passes COMMAND and OPTIONS it to the init script unmodified. All scripts should support at least the start and stop commands. As a special case, if COMMAND is --full-restart, the script is run twice, first with the stop command, then with the start command. service --status-all runs all init scripts, in alphabetical order, with the status command. EXIT CODES
service calls the init script and returns the status returned by it. FILES
/etc/init.d The directory containing System V init scripts. ENVIRONMENT
LANG, TERM The only environment variables passed to the init scripts. SEE ALSO
/etc/init.d/skeleton, update-rc.d(8), init(8), invoke-rc.d(8). Jan 2006 service(8)
All times are GMT -4. The time now is 12:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy