Sponsored Content
Full Discussion: change the output
Top Forums Shell Programming and Scripting change the output Post 302147730 by Franklin52 on Wednesday 28th of November 2007 06:44:51 AM
Old 11-28-2007
Not sure what you're trying to do with the script "/tmp/myprogram".
Besides of that, the shebang (the first line) of your script isn't proper, it should be:
Code:
#!/bin/ksh

Anyway, did you get the right output with the awk or cut command?

Regards
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to Change Uname output?

I want replace 2.6.15-25-server with 2.6.17 ? $uname -r 2.6.15-25-server 1) mv /bin/uname /bin/uname.orig 2) put the following in the new /bin/uname: #!/bin/sh echo Uname (New Version) /bin/uname.orig :confused: (3 Replies)
Discussion started by: pop_black
3 Replies

2. Shell Programming and Scripting

How to Change Uname output?

I want use fake uname anyone can guide? (9 Replies)
Discussion started by: redstaing
9 Replies

3. Shell Programming and Scripting

Change output if file is empty

I'm very new to writing scripts, so here is my problem...I have the following code already written (in perl) system "rm file2"; open(FILE2, ">file2"); open(MYINPUTFILE, "file"); while(<MYINPUTFILE>) { my($line) = $_; chomp($line); print file2 "$line\n"; print... (2 Replies)
Discussion started by: ddrew78
2 Replies

4. Emergency UNIX and Linux Support

Read file and change a 0 to a 1 in output

<key>ExcludeSimpleHostnames</key> <integer>0</integer> <key>FTPPassive</key> Need simple command that will change the 0 to a 1 in this file when I grep it, but only for this integer key directly after the ExcludeSimpleHostnames key. I got this output code... (8 Replies)
Discussion started by: glev2005
8 Replies

5. Shell Programming and Scripting

change the output format

when i run the following command db2 list tablespaces Tablespaces for Current Database Tablespace ID = 0 Name = SYSCATSPACE State = 0x0000 Tablespace ID ... (3 Replies)
Discussion started by: lazydev
3 Replies

6. Shell Programming and Scripting

How can I change is output format by awk ?

Hello, Can you tell me how can I change this format by awk Input 0.2057422D-01 0.2463722D-01 -0.1068047D-02 Output 0.02057422 0.02463722 -0.001068047 Thanks wan (8 Replies)
Discussion started by: wanchem
8 Replies

7. Shell Programming and Scripting

find output seems to change when piped

Currently, i am trying to create a simple robust script that is intended to move the contents of a given source directory to a target directory. Optionally, the script should allow to either move the whole source dir content, or dotfiles only, or visible files only. I am aware the target directory... (0 Replies)
Discussion started by: shells_bells
0 Replies

8. Shell Programming and Scripting

change output format using ksh

I have a script that reaches out to several systems and pulls back infomation in serveral files. I would like to take the infomation returned and reformat it so I can export it to excel. Below is current output: File1:item1:abc=1 File1:item2:efg File2:item1:ab=1 File2:item2:efg... (3 Replies)
Discussion started by: oldman2
3 Replies

9. Shell Programming and Scripting

awk - Why does output order change?

I have this END section in an awk script: END { for (j in littlebin) { print (j, int(log(j)/log(2)) , littlebin) lbsum+=littlebin } for (i in bins) ... (6 Replies)
Discussion started by: treesloth
6 Replies

10. UNIX for Dummies Questions & Answers

Extract name from path and change output

Dear All, I would like to extract the file name without extension form a variable... In particular I have a command like this one: for file in path/to/file/example_number.ext do something -input $file -output ${file%_number.ext}.new done means that in variable $file are saved all the path... (3 Replies)
Discussion started by: giuliangiuseppe
3 Replies
ANNOTATE-OUTPUT(1)					      General Commands Manual						ANNOTATE-OUTPUT(1)

NAME
annotate-output - annotate program output with time and stream SYNOPSIS
annotate-output [options] program [args ...] DESCRIPTION
annotate-output will execute the specified program, while prepending every line with the current time and O for stdout and E for stderr. OPTIONS
+FORMAT Controls the timestamp format, as per date(1). Defaults to "%H:%M:%S". -h, --help Display a help message and exit successfully. EXAMPLE
$ annotate-output make 21:41:21 I: Started make 21:41:21 O: gcc -Wall program.c 21:43:18 E: program.c: Couldn't compile, and took me ages to find out 21:43:19 E: collect2: ld returned 1 exit status 21:43:19 E: make: *** [all] Error 1 21:43:19 I: Finished with exitcode 2 BUGS
Since stdout and stderr are processed in parallel, it can happen that some lines received on stdout will show up before later-printed stderr lines (and vice-versa). This is unfortunately very hard to fix with the current annotation strategy. A fix would involve switching to PTRACE'ing the process. Giving nice a (much) higher priority over the executed program could however cause this behaviour to show up less frequently. The program does not work as well when the output is not linewise. In particular, when an interactive program asks for input, the question might not be shown until after you have answered it. This will give the impression that the annotated program has hung, while it has not. SEE ALSO
date(1) SUPPORT
This program is community-supported (meaning: you'll need to fix it yourself). Patches are however appreciated, as is any feedback (posi- tive or negative). AUTHOR
annotate-output was written by Jeroen van Wolffelaar <jeroen@wolffelaar.nl> This manpage comes under the same copyright as annotate-output itself, read /usr/bin/annotate-output (or wherever you install it) for the details. DEBIAN
Debian Utilities ANNOTATE-OUTPUT(1)
All times are GMT -4. The time now is 04:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy