Help need in Grep Command

Hi

I am assaging a variable like this

current_dir ='ps -o user|grep -v'USER'|uniq' #this would print the user id "

v_name=`date +%m%d%y`
outputfile =$v_name$current_dir.txt

this gives the output file with timeanddate .txt but not the userid

lets assume i have the userrid called uuuu1 and time 1507

the output file should be uuuu11507.txt

can you help me on this !!!!!!!!!

i found the solution for it .. the issue was the quotes

but a small problem here it prints with a space

modified uuuuu11507.txt

how to trim those spaces

What spaces?

What is the script you are using?

current_dir ='ps -o user|grep -v'USER'|uniq' #this would print the user id "

v_name=`date +%m%d%y`

Assuming current_dir has username and v_name has date and time.

file name u should use

${current_dir}${v_name}.txt

Ur filename looks like uday101007.txt

Uh sorry... Post deleted :slight_smile: