My program ls does not change the directory after putting it as an argument

OP (Company: no) #5065182
Rate this post
• ▲ useful
▼ not useful
I attached the program to the file
See what the problem is, I enter the command into the console ./ls /bin:
1
   [aid_media_rw
2
  ..    [aid_media_rw
3
  fs    [aid_media_rw
4
  bus    [aid_media_rw
5
  dev    [aid_media_rw
6
  ccci    [aid_media_rw
7
  devices    [aid_media_rw
8
  block    [aid_media_rw
9
  class    [aid_media_rw
10
  power    [aid_media_rw
11
  firmware    [aid_media_rw
12
  kernel    [aid_media_rw
13
  mtk_rgu    [aid_media_rw
14
  mtk_ssw    [aid_media_rw
15
  module    [aid_media_rw
16
  mtuart    [aid_media_rw
17
  sys_info    [aid_media_rw
18
  board_properties    [aid_media_rw
19
  bootinfo    [aid_media_rw
And now I'm referring to the program by going to the folder where I want 
to output the files.
Run /mnt/programs/ls .
1
 [root    
2
  ..    [root    
3
  fs    [root    
4
  bus    [root    
5
  dev    [root    
6
  ccci    [root    
7
  devices    [root    
8
  block    [root    
9
  class    [root    
10
  power    [root    
11
  firmware    [root    
12
  kernel    [root    
13
  mtk_rgu    [root    
14
  mtk_ssw    [root    
15
  module    [root    
16
  mtuart    [root    
17
  sys_info    [root    
18
  board_properties    [root    
19
  bootinfo    [root
How to see the username is different in two outputs. I still can not 
understand what the problem is and ask for help!
Attached files:

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.