Urgent Help on "Script Command" on a shell script

 
Thread Tools Search this Thread
Homework and Emergencies Emergency UNIX and Linux Support Urgent Help on "Script Command" on a shell script
# 8  
Old 06-29-2010
Please show what you tried and what happened. Obviously "script" must not be running if you want to capture the output using shell commands.
# 9  
Old 06-29-2010
script command will open a new shell and only when u type exit can it end .. i m not sure u can use the command like that inside the script .. if capturing the output and error of the commands fired is ur goal then why dont u use 2>&1 .. that should suffice ur need .
# 10  
Old 07-01-2010
MySQL

use bactics.

generally when you write in a script, you use them.

i am not sure if it will work but you may try that out.
# 11  
Old 07-03-2010
Update: (Linux) kernel.org version of script

Hi.

I tried solution # 2 in post # 7. The kernel.org command script did not compile on aix (a few errors with header files as I recall), whereas it did compile without errors on GNU/Debian Linux.

I don't have access to an SCO box, so I used aix simply because it was different from Linux, as SCO is different from Linux. The result was not totally unexpected, and was a good exercise. I did not investigate farther ... cheers, drl
# 12  
Old 07-05-2010
Hi,

Thanks for all your inputs. I tried lot of things inside the shell script to use this script ( I cannot install any extra utilities on the boxes) but still looking for a exit from the shell prompt. So we decided to use some other methods.

Thanks for all your help.

Regards,

Ravi
# 13  
Old 10-08-2010
Depending on your operating system you should try both :

a) /sbin/initprivs 2>&1 >mylogfile

b) /sbin/initprivs >mylogfile 2>&1

For example, i guess in HP-UX, the first one put the error into the log file which is what you may expect, but if you use Solaris, this will fail since the error has been sent to file descriptor 1 before it has been told to redirect into the log file : in Solaris, you should then use the way b).

Or just ...

/sbin/initprivs >initprivs.log 2>initprivs.err

you could either use | tee logfile or |tee -a logfile (fork the display to the logfile, 'a' stand for append)
# 14  
Old 10-08-2010
After 5 months I cannot relate the most recent post to the original post (which was about the unix "script" command.
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

expect script not running in cron "Urgent"

I wrote a script to download the files from sftp location to local. while running the script manually its working fine. when i schedule the same in cron its not working.... :wall::wall: here is the script: #!/bin/bash ... (2 Replies)
Discussion started by: ganga39
2 Replies

3. Shell Programming and Scripting

Script invoked using "sh" is not executing. Urgent help required

Hi , I am new to shell scripting. I am using Linux for doing scripting. Below is my script, which takes 2 parameters as input. test.sh has the below: #!/bin/bash . $HOME/.profile gpg --yes --no-use-agent -r "$(eval echo \$$2_Var)" -e $1 1st parameter is command line... (7 Replies)
Discussion started by: rangarb
7 Replies

4. 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

5. UNIX for Advanced & Expert Users

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

6. UNIX for Dummies Questions & Answers

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

7. Shell Programming and Scripting

"sed" command is not working in shell script

Hi All, I am not much strong in shell scripting... I am using sed command in my script to find and replace a string....... This is how script looks : ############# #!/usr/bin/ksh CONFIG_FILE=iom_test.txt FIND=`echo "NIS_FTP_SERVER1=123.456.iom.com"` REPLACE=`echo... (2 Replies)
Discussion started by: askumarece
2 Replies

8. AIX

"too big" and "not enough memory" errors in shell script

Hi, This is odd, however here goes. There are several shell scripts that run in our production environment AIX 595 LPAR m/c, which has sufficient memory 14GB (physical memory) and horsepower 5CPUs. However from time to time we get the following errors in these shell scripts. The time when these... (11 Replies)
Discussion started by: jerardfjay
11 Replies

9. Shell Programming and Scripting

passing a list of dynamic names to a "PS" command in shell script?

Hi, I am new to shell script. This is my first post .I have written a small script which returns list of names starts with "ram" in /etc/passwd .Here is that:- #!/bin/ksh NAME_LIST="name_list.txt" cat /dev/null > $NAME_LIST evalcmd="cat /etc/passwd | grep "^ram?*" | cut -d: -f1" eval... (3 Replies)
Discussion started by: sachin.tendulka
3 Replies

10. Shell Programming and Scripting

Q: Recording shell script screen output using "script" command ?

Hello, I need to capture everything showed on a screen by a shell script which needs user interaction. The shell script performs commads such as rsh so normal redirection to a file does not work. I know there is a special unix command call "script" which records screen session but the... (4 Replies)
Discussion started by: lalfonso.gomez
4 Replies
Login or Register to Ask a Question