Sponsored Content
Operating Systems Solaris Sunsolaris shell script runs only as super user Post 302193419 by fabtagon on Friday 9th of May 2008 08:20:56 AM
Old 05-09-2008
pretty obvious:
Code:
ksh[line]: awk: not found

Your $PATH environment variable as normal user does not consist of the directory where your awk resides. What give "which awk" and "echo $PATH" as superuser? What gives "echo $PATH" as normal user? Add the missing dir to normal user's $PATH.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Script: want to insert values in database when update script runs

Hi , I am new to linux and also also to shell scripting. I have one shell script which unpacks .tgz file and install software on machine. When this script runs I want to insert id,filename,description(which will be in readme file),log(which will be in log file) and name of unpacked folder... (1 Reply)
Discussion started by: ring
1 Replies

2. Shell Programming and Scripting

Script using awk works only as super user

hi friends, I am a new Sun Solaris 10 user. I have the following script line=$(awk '{if(substr($0,1,1)!="#" && substr($0,1,1)!=";" && substr($0,1,1)!=" " && substr($0,1,1)!="/" && substr($0,1,1)!="*" && substr($0,1,1)!="\\" && length($0)!=0) ... (10 Replies)
Discussion started by: gjithin
10 Replies

3. Shell Programming and Scripting

How do i change to super user then revert back to ordinary user ,using shell script?

Hi all, I am trying to eject the cdrom from a livecd after certain stage... Now assuming that it is possible to eject,please consider my issue!!! The OS boots into a regular user by default...so i am unable to use the eject command to push out the drive... However if i try pfexec eject it... (3 Replies)
Discussion started by: wrapster
3 Replies

4. Shell Programming and Scripting

Shell script which runs sql script

Hi all, I need a shell script which runs a sql script but I couldn't find how to finish it. This is the code that I have: #! /usr/bin/ksh export SHELL=/bin/ksh export ORACLE_SID=database export ORACLE_HOME=/opt/oracle/product/9.2.0.8 sqlplus user <<EOF @/path/path/path/scriptname.sql... (3 Replies)
Discussion started by: Geller
3 Replies

5. Shell Programming and Scripting

CRON shell script only runs correctly on command line

Hi, I'm new to these forums, and I'm hoping that someone can solve this problem... To make things short: I have DD-wrt set up on a router. I'm trying to run a script in CRON that fetches the daily password from my database using SSH. CRON is set like so(in web interface): * * * *... (4 Replies)
Discussion started by: louieaw
4 Replies

6. Shell Programming and Scripting

Shell script that runs a random shell script

Hi, im trying to make a shell script that basically runs a random shell script form a list of shell scripts i specify. Im not very good at writing shell scripts, and am new to linux. Thanks in advance :) (15 Replies)
Discussion started by: kylecn
15 Replies

7. Shell Programming and Scripting

Need to run a bash script that logs on as a non-root user and runs script as root

So I have a script that runs as a non-root user, lets say the username is 'xymon' . This script needs to log on to a remote system as a non-root user also and call up a bash script that runs another bash script as root. in short: user xymon on system A needs to run a file as root user and have... (2 Replies)
Discussion started by: damang111
2 Replies

8. Shell Programming and Scripting

Shell Script runs good manually but not through Cron tab

Hello Every one, I have a shell script which is running fine manually, but its giving me hard time when running tru cron job. :wall:. Am using #!/usr/bin/ksh >echo $SHELL /usr/bin/ksh Cron Job is as below, it execues but dosent do what i want it to do. 47 15 * * *... (1 Reply)
Discussion started by: naren.chowdhary
1 Replies

9. UNIX for Dummies Questions & Answers

Script only runs as a particular user

Hi guys So I've got this PERL script that for one reason or another I need to run as a user other than the user that created the script. When I su - to another user the script won't run and doesn't give me any output as to why. No permission denied or anything like that. I've chmod 777'd the... (5 Replies)
Discussion started by: Jaymoney
5 Replies

10. AIX

Script runs in shell but not cron

We run some menu driven software that has the ability to batch menu paths and generate reports quickly. Normally you run a batch like: $ BATCH BATCHNAME The batch program then prompts you for the date you want the report run for. I got some help from some folks on IRC to do the following: BATCH... (2 Replies)
Discussion started by: herot
2 Replies
Env(3pm)						 Perl Programmers Reference Guide						  Env(3pm)

NAME
Env - perl module that imports environment variables as scalars or arrays SYNOPSIS
use Env; use Env qw(PATH HOME TERM); use Env qw($SHELL @LD_LIBRARY_PATH); DESCRIPTION
Perl maintains environment variables in a special hash named %ENV. For when this access method is inconvenient, the Perl module "Env" allows environment variables to be treated as scalar or array variables. The "Env::import()" function ties environment variables with suitable names to global Perl variables with the same names. By default it ties all existing environment variables ("keys %ENV") to scalars. If the "import" function receives arguments, it takes them to be a list of variables to tie; it's okay if they don't yet exist. The scalar type prefix '$' is inferred for any element of this list not prefixed by '$' or '@'. Arrays are implemented in terms of "split" and "join", using $Config::Config{path_sep} as the delimiter. After an environment variable is tied, merely use it like a normal variable. You may access its value @path = split(/:/, $PATH); print join(" ", @LD_LIBRARY_PATH), " "; or modify it $PATH .= ":."; push @LD_LIBRARY_PATH, $dir; however you'd like. Bear in mind, however, that each access to a tied array variable requires splitting the environment variable's string anew. The code: use Env qw(@PATH); push @PATH, '.'; is equivalent to: use Env qw(PATH); $PATH .= ":."; except that if $ENV{PATH} started out empty, the second approach leaves it with the (odd) value "":."", but the first approach leaves it with ""."". To remove a tied environment variable from the environment, assign it the undefined value undef $PATH; undef @LD_LIBRARY_PATH; LIMITATIONS
On VMS systems, arrays tied to environment variables are read-only. Attempting to change anything will cause a warning. AUTHOR
Chip Salzenberg <chip@fin.uucp> and Gregor N. Purdy <gregor@focusresearch.com> perl v5.18.2 2013-11-04 Env(3pm)
All times are GMT -4. The time now is 06:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy