cancel
Showing results for 
Search instead for 
Did you mean: 
Bert-Schuurman
Mission Specialist
Mission Specialist
  • 176 Views

RH124 - ch05s06 - 2.3 not working

Dear ROL Support,

When following 2.3 i get the error message.

Error:
[student@servera 13:16:03 ~] $ rm $file
rm: missing operand
Try 'rm --help' for more information.

Cloud you investigate it ?

0 Kudos
4 Replies
  • 167 Views

Did you assign properly the value for the variable $file ?

It seems the value is empty. Try an echo $file to get it's value

0 Kudos
Bert-Schuurman
Mission Specialist
Mission Specialist
  • 146 Views

[student@servera  ~]$ ls -l $file -rw-r--r--. 1 student student 0 Jan 23 14:59 tmp.zdkei083
0 Kudos
Bert-Schuurman
Mission Specialist
Mission Specialist
  • 146 Views

The varible look up works fine.

0 Kudos
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 124 Views

It's probably too late, but could you post the results of the history command?

You should have done this (Note: there is NO SPACE on each side of the =

[student@servera 14:47:05 ~]$ file=tmp.zdkei083

then

[student@servera 14:48:35 ~]$ echo $file
tmp.zdkei083

then 

[student@servera 14:59:07 ~]$ ls -l $file
-rw-r--r--. 1 student student 0 Jan 23 14:59 tmp.zdkei083

then

[student@servera 14:59:10 ~]$ rm $file

alternatively, to use verbose mode

[student@servera 14:59:10 ~]$ rm -v $file
removed 'tmp.zdkei083'

So I just did it and it worked fine:

Tracy_Baker_0-1733338994475.png

 

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
0 Kudos
Join the discussion
You must log in to join this conversation.