Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

rm /etc/profile: line 33: id: command not found

Why can't run simple command like pwd and rm, but unzip works?



 1 08/28/12 03:09PM STEP Step using selector 'rfksappd02_c999752'.
134	08/28/12 03:09PM	EXEC	Locale set to 'C'
135	08/28/12 03:09PM	PTY	allocated pseudo-tty pipe
255	08/28/12 03:09PM	EXEC	Performing variable expansion on command line
256	08/28/12 03:09PM	EXEC	spawning shell [/bin/bash]
257	08/28/12 03:09PM	SCRIPT	pwd
258	08/28/12 03:09PM	SCRIPT	rm -Rf bldforge_AOMS_DEV
259	08/28/12 03:09PM	SCRIPT	rm AOM_Dev_Full_Build_r1.3.11_TxCX_120828135108_B494.zip
260	08/28/12 03:09PM	SCRIPT	unzip -o AOM_Dev_Full_Build_r1.3.11_TxCX_120828150815_B494.zip
261	08/28/12 03:09PM	EXEC	start [/home/c999752@rfksappd02]
262	08/28/12 03:09PM	EXEC	/etc/profile: line 33: id: command not found
263	08/28/12 03:09PM	EXEC	/etc/bashrc: line 8: id: command not found
264	08/28/12 03:09PM	EXEC	/etc/bashrc: line 8: id: command not found
265	08/28/12 03:09PM	EXEC	
266	08/28/12 03:09PM	EXEC	/home/c999752
267	08/28/12 03:09PM	EXEC	-bash: line 4: rm: command not found
268	08/28/12 03:09PM	EXEC	-bash: line 5: rm: command not found
269	08/28/12 03:09PM	EXEC	Archive:  AOM_Dev_Full_Build_r1.3.11_TxCX_120828150815_B494.zip
270	08/28/12 03:09PM	EXEC	  inflating: bldforge_AOMS_DEV/WebSphere_AVOB/AOMS_FDN/Foundation/extensions/global/entities/Extensions.xml  

0 votes


Accepted answer

Permanent link
 Something is missing from your PATH env var.  You should see PATH listed in the ENV section of your step log.  usually it would look similar to this: /usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Depending on your system, unzip, id, and rm may all be in different directories from mine.  I would suggest logging in from the command-line, find out where these commands are located (try "which rm" for instance to locate the rm command) and then look at the PATH variable to make sure all of the directories you need are in there.


Robert haig selected this answer as the correct answer

1 vote

Comments

Right, I have PATH=Z:;PATH in the env. It was for Windows agents. I need to create a new environment for this server.

Sorry, I didn't finish reading your reply. My rm command is in /bin. It works after adding that to my PATH. Thanks.


4 other answers

Permanent link
It's still not working. I set the PATH to the right one, as you can see I tried from unix command and it works.
252	08/28/12 04:35PM	ENV	LANG=C
253	08/28/12 04:35PM	ENV	PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb::/usr/bin/X11:/sbin:/opt/rational/clearcase/bin:/opt/rational/clearcase/etc/utils:.254	08/28/12 04:35PM	ENV	REMOTE_HOST=::ffff:10.1.131.23
	
255	08/28/12 04:35PM	EXEC	Performing variable expansion on command line
257	08/28/12 04:35PM	EXEC	spawning shell [/bin/bash]
258	08/28/12 04:35PM	SCRIPT	pwd
259	08/28/12 04:35PM	SCRIPT	rm -Rf bldforge_AOMS_DEV
260	08/28/12 04:35PM	SCRIPT	rm AOM_Dev_Full_Build_RETAGGING_16.zip
261	08/28/12 04:35PM	SCRIPT	unzip -o AOM_Dev_Full_Build_HPPC_BUILD_TAG.zip
262	08/28/12 04:35PM	EXEC	start [/home/c999752@rfksappd02.hbc.com]
263	08/28/12 04:35PM	EXEC	/home/c999752
264	08/28/12 04:35PM	EXEC	-bash: line 4: rm: command not found
265	08/28/12 04:35PM	EXEC	-bash: line 5: rm: command not found
	


[c999752@rfksappd02 ~]$ set PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb::/usr/bin/X11:/sbin:/opt/rational/clearcase/bin:/opt/rational/clearcase/etc/utils:.
[c999752@rfksappd02 ~]$ rm
rm: missing operand
Try `rm --help' for more information.
[c999752@rfksappd02 ~]$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/home/c999752/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb::/usr/bin/X11:/sbin:/opt/rational/clearcase/bin:/opt/rational/clearcase/etc/utils:.:/home/c999752/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb::/usr/bin/X11:/sbin:/opt/r
[c999752@rfksappd02 ~]$ rm
rm: missing operand
Try `rm --help' for more information.
	

0 votes


Permanent link
 This is my step command:

.tset env "PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb::/usr/bin/X11:/sbin:/opt/rational/clearcase/bin:/opt/rational/clearcase/etc/utils:."
pwd
rm -Rf ${HPPC_DEV_VIEW}
rm ${BF_PROJECTNAME}_${BF_LASTTAG}.zip
unzip -o ${BF_PROJECTNAME}_${HPPC_BUILD_TAG}.zip

0 votes


Permanent link
note that the :: and the . in your path are functionally equivalent. It is also not a good security best practice to have . or a null (::) in your path as someone could put a malicious program named "ls" in a directory and if you were in that directory when you executed "ls" it could compromise your account.

0 votes

Comments

I tried the following: .tset env "PATH=$PATH", but the result is something like "PATH=Z:;PATH", which looks the PATH set in the project environment (Z:\;%PATH%) for the windows environment.

What I want is actually the current $path in the unix agent. How can I do that?

set an env var named PATH in an environment group. apply that group to your unix server. in that group, set the value to be "PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb::/usr/bin/X11:/sbin:/opt/rational/clearcase/bin:/opt/rational/clearcase/etc/utils:."

you do not need to use .tset

alternatively you could set the path in your step using a shell command export PATH=/usr/local/bin:/usr/bin:/bin rm filename


Permanent link
 set an env var named PATH in an environment group.  apply that group to your unix server.  in that group, set the value to be "PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb::/usr/bin/X11:/sbin:/opt/rational/clearcase/bin:/opt/rational/clearcase/etc/utils:." 
<br><br>
you do not need to use .tset

alternatively you could set the path in your step using a shell command
  export PATH=/usr/local/bin:/usr/bin:/bin
  rm filename

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 17
× 7

Question asked: Aug 28 '12, 3:19 p.m.

Question was seen: 7,414 times

Last updated: Aug 29 '12, 3:53 p.m.

Confirmation Cancel Confirm