linux - Why PROMPT_COMMAND seems to be empty when i acces using system system call in c -


i have defined prompt_command in /etc/profile shown below,

 prompt_command = date 

now when print prompt_command c code using system system call shown below not displaying anything,

system("echo pwd;echo whoami;echo \"p_cmd = $prompt_command\";eval $prompt_command"); 

output:

\root  root  p_cmd =  

please clarify following doubt

why prompt_command showing empty?

you prompt_command has not been exported, try:

export prompt_command=date 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -