Script command error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script command error
# 1  
Old 09-15-2006
Script command error

Hi Everyone!!

I have created a menubased shellscript. I'm going to give a user to invoke the menu autometically every time he logs in to the system. I want all the activity to be logged for that user. I have done the following thing to to this.

SHELL=/full/path/name/of/my/menu.ksh
export SHELL
script -a logfile

As soon as the user logs in .profile is executed. When "script" command is executed menu is invoked as the shell is set to menu.ksh.

Using the menu I'm starting 2 daemon processes using the nohup and & combination.
The process starts successfully. The parent process id changes to 1 as expected. however terminal is still showing /dev/pts/1.
As soon as i log out of the menu My process gets killed.

I used at command to start the daemon.. however at is restricted in our environment.

Can anyone help me on this problem.

Regards,
VK
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 with awk command ERROR

Hello im new here... Im trying to read file and create folders from words in it but i get this for loop error awk : line 3 : syntax error at or near for my code is.. #!/bin/bash begin for (( i=1;i<=5;i++)); do awk -v i=$i $0 { print $i } mkdir $i done {print $i} end {} i have... (7 Replies)
Discussion started by: boxstep
7 Replies

2. Shell Programming and Scripting

How to ignore error in command in bash script?

Hello, i have bash script where im cycling some command for different lines in external file. example: while read domain;do nslookupout=$(nslookup -type=ns $domain) || true another commands done < filenamewithdomains i added: || true after the command in belief it will just skip... (6 Replies)
Discussion started by: postcd
6 Replies

3. Shell Programming and Scripting

Getting Command not found error Even though Script is working fine

Hi friends, I am using below script to do some work. But even though script is working fine but while executing it i am getting command not found error. :( Here is the script :- #!/bin/sh Names="name.txt" ###main##### for LINE in `cat ${Names}` do ... (3 Replies)
Discussion started by: harpal singh
3 Replies

4. Shell Programming and Scripting

Error in script for set command

Hi All I have a function in a Linux script as follows echo `date`": Info: Started Checking File Pattern(s)" cat ${CM_FILE_SPLIT_LST} | while read SPLIT_INFO do #lets not expand wildcards set -f #FILE_PATTERN=`echo ${SPLIT_INFO} | awk '{FS="|"; print $1}'` ... (6 Replies)
Discussion started by: vee_789
6 Replies

5. Shell Programming and Scripting

Regarding Redirecting a command's default error message in script

Hi, I just need a small help. I have this simple script to check a huge list of IDs if they exist or not on a server. Before running I have tested it with only 5-6 IDs. Script works fine. But what I need it should not display the message of command's error message. That means if suppose an ID... (3 Replies)
Discussion started by: raj100
3 Replies

6. Shell Programming and Scripting

awk command in script gives error while same awk command at prompt runs fine: Why?

Hello all, Here is what my bash script does: sums number columns, saves the tot in new column, outputs if tot >= threshold val: > cat getnon0file.sh #!/bin/bash this="getnon0file.sh" USAGE=$this" InFile="xyz.38" Min="0.05" # awk '{sum=0; for(n=2; n<=NF; n++){sum+=$n};... (4 Replies)
Discussion started by: catalys
4 Replies

7. Shell Programming and Scripting

Find Command in the script throw error

Hi I have script that is developed to serch for 30 days old Directory & Files and then remove them ... when i run it successfully removes the Directory & files & but it throw errors on the screen .. .. + find . -type f -mtime +30 -exec rm -f {} ; + exit please help me ?? I... (0 Replies)
Discussion started by: Beginner123
0 Replies

8. Shell Programming and Scripting

Error executing shell command from a perl script

Hi Gurus, I've a find command that gets the list of files from a source directory where the extension is not html, xml, jsp, shtml or htaccess. The below find command runs fine from the command prompt or in a shell script. I need to eventually run it in a PERL script and am getting the... (5 Replies)
Discussion started by: voorkey
5 Replies

9. Shell Programming and Scripting

Perl Script Error with find command

Guys, I need to find all the files ending with either dmp or dmp.Z. This command is giving me error. @files =`find $path \(-name "*.dmp" -o -name "*.dmp.Z"\) -mtime +30`; sh: 0403-057 Syntax error at line 1 : `(' is not expected. Thanks in advance (4 Replies)
Discussion started by: MKNENI
4 Replies

10. Shell Programming and Scripting

mv command is giving error in shell script

Hi, In my shell script when I am using mv command using shell variables it is giving me error of syntax. Following is the shell script: file_edifice="*.txt" fquote="'" fdquote=\" for file in $file_edifice do file_name=$fquote$file$fquote tofile_name=`date... (5 Replies)
Discussion started by: gammit
5 Replies
Login or Register to Ask a Question
who(1)								   User Commands							    who(1)

NAME
who - who is on the system SYNOPSIS
/usr/bin/who [-abdHlmpqrstTu] [file] /usr/bin/who -q [-n x] [file] /usr/bin/who am i /usr/bin/who am I /usr/xpg4/bin/who [-abdHlmpqrtTu] [file] /usr/xpg4/bin/who -q [-n x] [file] /usr/xpg4/bin/who -s [-bdHlmpqrtu] [file] /usr/xpg4/bin/who am i /usr/xpg4/bin/who am I DESCRIPTION
The who utility can list the user's name, terminal line, login time, elapsed time since activity occurred on the line, and the process-ID of the command interpreter (shell) for each current UNIX system user. It examines the /var/adm/utmpx file to obtain its information. If file is given, that file (which must be in utmpx(4) format) is examined. Usually, file will be /var/adm/wtmpx, which contains a history of all the logins since the file was last created. The general format for output is: name [state] line time [idle] [pid] [comment] [exit] where: name User's login name state Capability of writing to the terminal line Name of the line found in /dev time Time since user's login idle Time elapsed since the user's last activity pid User's process id comment Comment line in inittab(4) exit Exit status for dead processes OPTIONS
The following options are supported: -a Processes /var/adm/utmpx or the named file with -b, -d, -l, -p, -r, -t, -T, and -u options turned on. -b Indicates the time and date of the last reboot. -d Displays all processes that have expired and not been respawned by init. The exit field appears for dead processes and contains the termination and exit values (as returned by wait(3UCB)), of the dead process. This can be useful in determining why a process terminated. -H Outputs column headings above the regular output. -l Lists only those lines on which the system is waiting for someone to login. The name field is LOGIN in such cases. Other fields are the same as for user entries except that the state field does not exist. -m Outputs only information about the current terminal. -n x Takes a numeric argument, x, which specifies the number of users to display per line. x must be at least 1. The -n option can only be used with -q. -p Lists any other process that is currently active and has been previously spawned by init. The name field is the name of the pro- gram executed by init as found in /sbin/inittab. The state, line, and idle fields have no meaning. The comment field shows the id field of the line from /sbin/inittab that spawned this process. See inittab(4). -q (Quick who) Displays only the names and the number of users currently logged on. When this option is used, all other options are ignored. -r Indicates the current run-level of the init process. -s (Default) Lists only the name, line, and time fields. /usr/bin/who -T Same as the -s option, except that the state idle, pid, and comment, fields are also written. state is one of the following charac- ters: + The terminal allows write access to other users. - The terminal denies write access to other users. ? The terminal write-access state cannot be determined. /usr/xpg4/bin/who -T Same as the -s option, except that the state field is also written. state is one of the characters listed under the /usr/bin/who version of this option. If the -u option is used with -T, the idle time is added to the end of the previous format. -t Indicates the last change to the system clock (using the date utility) by root. See su(1M) and date(1). -u Lists only those users who are currently logged in. The name is the user's login name. The line is the name of the line as found in the directory /dev. The time is the time that the user logged in. The idle column contains the number of hours and minutes since activity last occurred on that particular line. A dot (.) indicates that the terminal has seen activity in the last minute and is therefore ``current.'' If more than twenty-four hours have elapsed or the line has not been used since boot time, the entry is marked old. This field is useful when trying to determine whether a person is working at the terminal or not. The pid is the process-ID of the user's shell. The comment is the comment field associated with this line as found in /sbin/inittab (see init- tab(4)). This can contain information about where the terminal is located, the telephone number of the dataset, type of terminal if hard-wired, and so forth. OPERANDS
The following operands are supported: am i In the "C" locale, limits the output to describing the invoking user, equivalent to the -m option. The am and i or I must be sepa- am I rate arguments. file Specifies a path name of a file to substitute for the database of logged-on users that who uses by default. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of who: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, LC_TIME, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. FILES
/sbin/inittab Script for init /var/adm/utmpx Current user and accounting information /var/adm/wtmpx Historic user and accounting information ATTRIBUTES
See attributes(5) for descriptions of the following attributes: /usr/bin/who +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ /usr/xpg4/bin/who +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWxcu4 | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
date(1), login(1), mesg(1), init(1M), su(1M), wait(3UCB), inittab(4), utmpx(4), attributes(5), environ(5), standards(5) NOTES
Superuser: After a shutdown to the single-user state, who returns a prompt. Since /var/adm/utmpx is updated at login time and there is no login in single-user state, who cannot report accurately on this state. The command, who am i, however, returns the correct information. SunOS 5.11 3 Nov 2000 who(1)