I have assigned a work to take take all process and make them into a statement. So I tried this script.
#!/bin/bash
a= ps | awk '{print $1}'
echo select $a
So I am getting this output
PID
1838
1839
1840
13226
select
I know that a
variable is taking many arguments and unable to insert into one, but i am unable to get the logic.
I want a output similar to this.
select 1838, 1839, 1840, 13226
Thanks in advance.
select
and actually I want ','(comma) also in middle of them. And the pid is coming how can I restrict that ?