Suppressing the automatic output of "script"


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Suppressing the automatic output of "script"
# 1  
Old 01-07-2010
Suppressing the automatic output of "script"

Is there a way to suppress the output that script command displays - "Script command started..."
# 2  
Old 01-07-2010
If you want the output to be suppressed...
Code:
command >> /dev/null

If you want the stderr to be suppressed...
Code:
command 2>>/dev/null

# 3  
Old 01-07-2010
I tried the first one, and now, nothing is being written to screen. How do I restore it? Please help.
# 4  
Old 01-07-2010
Oops, you cannot, because it redirected to /dev/null.

From wiki:
Code:
/dev/null or the null device is a special file that discards all data written to it

If you want that to see later, then you have to redirect to a file as

Code:
ls >> /tmp/output-file

Then view it using, any commands which you will use for viewing a file.
# 5  
Old 01-07-2010
Quote:
Originally Posted by ggayathri
Is there a way to suppress the output that script command displays - "Script command started..."
Hello ,
thats the stdout( standard output ) that is being written on the screen . If you supress it there would not be any output provided by the script. so it cant be suppressed.
If however you want to supress it, then edit the shell script to modify what you want to see on the console and what you dont.

Regards.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. Shell Programming and Scripting

Automatic input "yes" in a shell script

Hi All, I need a favour. I have a file called "redhat_servers.txt" containing some server names line by line. When I try to ssh to each server, and I have already done with ssh key-gen stuff. Now, for first time if I do ssh .. I need to type yes I have more than 400 servers...it will take... (4 Replies)
Discussion started by: kumar85shiv
4 Replies

3. Shell Programming and Scripting

What is the right way to redirect script output use ">" or ">>" ?

Which one of the following are more accurate and why? nohup myScript.sh 1>nohup_$(date +%Y%m%d%H%M%S).out 2>&1 & nohup myScript.sh 1>>nohup_$(date +%Y%m%d%H%M%S).out 2>&1 & nohup myScript.sh >nohup_$(date +%Y%m%d%H%M%S).out 2>&1 & nohup myScript.sh >>nohup_$(date +%Y%m%d%H%M%S).out 2>&1 &... (3 Replies)
Discussion started by: kchinnam
3 Replies

4. AIX

"Frames" and "Words" in fcstat output

What are "Frames" and "Words" in the fcstat output? vio1:/home/padmin:# fcstat fcs0 <snip> Transmit Statistics Receive Statistics ------------------- ------------------ Frames: 122844229 363445456 Words: 50940091904 171210861568 <snip> The... (1 Reply)
Discussion started by: kah00na
1 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

"Join" or "Merge" more than 2 files into single output based on common key (column)

Hi All, I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations: 1. I am restrained to 2 input files only. 2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
Discussion started by: Katabatic
1 Replies

7. UNIX for Dummies Questions & Answers

Explanation of "total" field in "ls -l" command output

When I do a listing in one particular directory (ls -al) I get: total 43456 drwxrwxrwx 2 root root 4096 drwxrwxrwx 3 root root 4096 -rwxrwxr-x 1 nobody nobody 3701594 -rwxrwxr-x 1 nobody nobody 3108510 -rwxrwxr-x 1 nobody nobody 3070580 -rwxrwxr-x 1 nobody nobody 3099733 -rwxrwxr-x 1... (1 Reply)
Discussion started by: proactiveaditya
1 Replies

8. UNIX for Dummies Questions & Answers

suppressing an error message using the "ls" command

hi I'm new here so my question maybe be retarded or out of place: Is there a way to suppress the "No such file or directory" error message when using the "ls" command ? thanks (5 Replies)
Discussion started by: basher400
5 Replies

9. Shell Programming and Scripting

problem while suppressing "$"

Hi, I have the following code in the make file echo " swremove \`swlist -l product | grep someproduct| awk '{print $1}'\` ">>filename i want swremove `swlist -l product | grep someproduct|awk '{print $1}'` to appear. Please can any one help how to suppress $??... I tried \$... (2 Replies)
Discussion started by: rag84dec
2 Replies

10. Debian

Debian: doubt in "top" %CPU and "sar" output

Hi All, I am running my application on a dual cpu debian linux 3.0 (2.4.19 kernel). For my application: <sar -U ALL> CPU %user %nice %system %idle ... 10:58:04 0 153.10 0.00 38.76 0.00 10:58:04 1 3.88 0.00 4.26 ... (0 Replies)
Discussion started by: jaduks
0 Replies
Login or Register to Ask a Question