Initialization Problems - Cannot execute automatically


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Initialization Problems - Cannot execute automatically
# 1  
Old 03-03-2009
Initialization Problems - Cannot execute automatically

Figured out the first half but am still having a little trouble shooting problem with the Initialization Files. I am working in bash on a remote server.

When I log on I am seeing the correct prompt but right before that I am also seeing this

Quote:
-bash: [: id -u: integer expression expected
[myname@mystuff myname]$
the id -u integer expression expected is what I can't get my head around at the moment.


This is what I have in my /etc/profile
Quote:
MAIL=/usr/mail/${LOGNAME:?}

#
# /etc/profile
# Systemwide environment and startup programs
# Functions and aliases go in /etc/bashrc
PATH="$PATH:/usr/local/bin"
PS1="[\u@\h \W]\\$ "
ulimit -c 1000000
if [ 'id -gn' = 'id -un' -a 'id -u' -gt 14 ]; then
umask 002
else
umask 022
fi
USER='id -un'
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
HOSTNAME='/bin/hostname'
HISTSIZE=1000
HISTFILESIZE=1000
export PATH PS1 HOSTNAME HISTSIZE HISTFILESIZE USER LOGNAME MAIL
for i in /etc/profile.d/*.sh ; do
if [ -x $i ]; then
. $i
fi
done
unset i #
any ideas as to why this is prompting??

Last edited by moonunit; 03-04-2009 at 05:00 AM.. Reason: Figured out the first half, need help again with second
# 2  
Old 03-06-2009
You need backtics, not single-quotes. So this line should be like this (copy/paste into your terminal if you can't see the difference on the web page):
Code:
if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then

# 3  
Old 03-06-2009
Ah THANKS!! knew it was a simple fix but I just couldn't see it
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Variable initialization

Hallo Team, I have a simple request and i would appreciate your help. I would like to use two dates in my script lets: A=$(date +"%d %B %Y") echo $A 23 June 2014 That's awesome now we cooking. Now i want B to be on the previous month eg: echo $B Should give me 23 May 2014 I would... (9 Replies)
Discussion started by: kekanap
9 Replies

2. Shell Programming and Scripting

Initialization error

new to shell scripting. below line is showing error in script. ${parameter:=word} in the o/p first it shows the below error. word: not found. and then in next line print "word" ---------------- p2: word: not found. word --------------------------- OS is AIX and shell is... (12 Replies)
Discussion started by: scriptor
12 Replies

3. Shell Programming and Scripting

Declaring variables without initialization

I get an error in my shell script that line 1: )unexpected. Line 1 in my script (using sh by the way) is the variable I declared but did not initialize it. result= Is this wrong? How can I fix it? I am using the variable later in the program, so I figured I could just declare it first... (4 Replies)
Discussion started by: itech4814
4 Replies

4. UNIX for Advanced & Expert Users

How to i execute .rdf file oracle report automatically in cron tab unix

Hi, I want to execute .rdf file which uses oracle report in crontab ..Can you please help me out how to schedule it crontab.as it is a rdf file Please give any suggestions regarding the above issue. (0 Replies)
Discussion started by: soumyamishra
0 Replies

5. Fedora

Automatically execute a software without gui at boot

hi all, this is my first post here...i hope that this is the correct section to write my question. I have a distro linux without gui, only text mode. So, it's possible run automatically a command or a program as "top" or "ping" and get the result on the main shell , after the boot and after... (6 Replies)
Discussion started by: gangiaemi
6 Replies

6. Shell Programming and Scripting

Automatically execute all programs in a directory

Hello. The last days I extended an open-source C++ library by some faster functions. This library provides a lot of short test programs which guarantee that the library works exactly. The compilation of each test works in a Makefile automatically. What I need is a shell script which... (5 Replies)
Discussion started by: max3000
5 Replies

7. Programming

Char initialization

Hi All, char a="\0"; a) a contains \0 a contains garbage value b) a contains \ a contains 0 a contains garbage value Pls, let me know correct result is a or b. I guess a. Thanks, Naga:cool: (2 Replies)
Discussion started by: Nagapandi
2 Replies

8. UNIX for Advanced & Expert Users

i want a script to execute if the time is 12:00 automatically

i write a script for displaying a xmessage.But i want it to run automatically for every one hour.can any one help me. (2 Replies)
Discussion started by: lakshmananindia
2 Replies

9. Programming

Struct Initialization

Hi We are using a code generator for initializing structures with the #define macro. Compiling it with the GCC 2.8.1 (with -ansi) it OK. But when we are using the SUN C 5.0 compiler it screams. Following is a code sample: #include <stdlib.h> #include <stdio.h> typedef struct TEST3 {... (4 Replies)
Discussion started by: amatsaka
4 Replies
Login or Register to Ask a Question