then: then/endif not found


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users then: then/endif not found
# 1  
Old 06-05-2009
then: then/endif not found

Hi All
I am getting this error when i try to run script from root using other user profile. Command I am running is

"su - user -c command"


Error envounterd

"then: then/endif not found"

Can any body please help me on this ...
# 2  
Old 06-05-2009
Try this...

su - user
<enter passwd>
then fire the commands....

-- Jayan Jayaseelan
# 3  
Old 06-05-2009
yes it is working like that...but i want to run it in single sommand as i want to crontab it.
It is working on one of my xun machine but not working in the other...
# 4  
Old 06-05-2009
The syntax from root cron would usually be:

Code:
su user -c "command"

Obviously this does not execute the user's profile - which is often an advantage.


Can you post the contents of the script and state which shell you are using? "endif" is from csh.

Last edited by methyl; 06-05-2009 at 01:20 PM.. Reason: Correction about "endif".
# 5  
Old 06-05-2009
the script is not running in c shell for bash shell its ok.
how can we check for c shell dependencies
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

If first pattern is found, look for second pattern. If second pattern not found, delete line

I had a spot of trouble coming up with a title, hopefully you'll understand once you read my problem... :) I have the output of an ldapsearch that looks like this: dn: cn=sam,ou=company,o=com uidNumber: 7174 gidNumber: 49563 homeDirectory: /home/sam loginshell: /bin/bash uid: sam... (2 Replies)
Discussion started by: samgoober
2 Replies

2. Programming

curses.h not found , gtk/gtk.h not found

i have downloaded <libncurses5-dev_5.7+20101128-1_i386.deb> and <ndk++-0.0.1alpha4.tar.bz2> which contains the header files curses.h and gtk/gtk.h .. i have also included them using .. #include "/home/ball/Desktop/Sudoku/project/libncurses5-dev_5.7+20101128-1_i386/usr/include/curses.h" ... (2 Replies)
Discussion started by: upvan111
2 Replies

3. Shell Programming and Scripting

if else endif using csh

I am trying to use csh to do an if statement as below if ( $tmaxf2 > $tmaxf1 ) then set tmax = $tmaxf2 else set tmax = $tmaxf1 endif Does not work and I'm getting if: Badly formed number. (0 Replies)
Discussion started by: kristinu
0 Replies

4. Shell Programming and Scripting

Need help ( sh: not found )

I have the script like this - When i try to running manually it's running as well, no error but when i put on the cronjob it give output Somebody can help me ? (6 Replies)
Discussion started by: justbow
6 Replies

5. Solaris

-sh: H: not found

I have found this error when i logged in as root: su - Any body have any idea where this error coming from or what is not working? -Adeel (1 Reply)
Discussion started by: deal732
1 Replies

6. Shell Programming and Scripting

Surrounding a chunk of code by #ifdef and #endif

Hello the great gurus :) I'm quite new to this, so perhaps I'm asking a simple and trivial question (which is good, because you'll answer for sure :)))) Anyway. I have an amount of *.c files (about 100), and what I want to do, is to surround a specific function call with #ifdef and #endif. ... (6 Replies)
Discussion started by: xxxaxa
6 Replies

7. UNIX for Dummies Questions & Answers

OM not found

Hello everybody: Im facing this weird problem on my SUN V890 running SOL9, from time to time I keep getting this error from the prompt when i press enter for blank: OM: not found sometimes if I entered a coomand it will give me: OM(command name):not found, but repeating the same command it... (4 Replies)
Discussion started by: aladdin
4 Replies

8. Shell Programming and Scripting

how can i check in csh if command found or not found ?

hello all im trying to use in sun Solaris the information received from the top command now i several machines that dont have install the top program so when im running the script im geting error saying after im running this code : set MemoryInfo = `top | grep Memory` if (... (2 Replies)
Discussion started by: umen
2 Replies

9. UNIX for Dummies Questions & Answers

HELP ld.so.1 NOT FOUND

I made the fatal mistake of rename the usr directory. I cannot run any commands due to the fact that ld.so.1 is in usr/lib/--and it doesn't exist How can I recover my system? (1 Reply)
Discussion started by: SmartJuniorUnix
1 Replies
Login or Register to Ask a Question