LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   variables question (https://www.linuxquestions.org/questions/linux-newbie-8/variables-question-406271/)

manicman 01-21-2006 03:17 PM

variables question
 
hi just a question about variables in scripts im trying to run this command with out using temporary files but im not sure how to do it
Code:

ps -A > ~/.temp
awk '/fbpanel/ { print $0 }'  ~/.temp

that searches for every application running called fbpanel is there a way a can alter it so that it doesn't write to the hardrive ? ive tried this
Code:

app=`ps -A`
awk '/fbpanel/ { print $0 }'  $app

but that doesnt work any ideas how this should be done ?

btmiller 01-21-2006 03:40 PM

Looks like you want a pipe:

Code:

ps -A | awk '/fbpanel/ { print $0 }'

manicman 01-21-2006 03:48 PM

thanks for that it worked perfectley :)


All times are GMT -5. The time now is 05:49 PM.