The time now is Wed 19 Jun 2013, 13:06
All times are UTC - 4 |
| Author |
Message |
musher0

Joined: 04 Jan 2009 Posts: 2273 Location: Gatineau (Qc), Canada
|
Posted: Wed 16 Jan 2013, 18:58 Post subject:
Can this one-liner be made more compact? [SOLVED] Subject description: Thanks in advance. |
|
Hello, all.
Can this one-liner be made more compact?
| Code: | | ps -e > ps.txt && grep -io "ROX-Filer" ps.txt && rm -f ps.txt |
If so, I can't see it just now.
Thanks in advance.
musher0
_________________
"To err is human; to really foul things up, you need a computer!" / "L'erreur est humaine; pour vraiment f... la m..., il faut un ordinateur." (Carleton University, banderole à la Rentrée 1979 / banner, start of 1979 school year) 
Last edited by musher0 on Wed 16 Jan 2013, 19:30; edited 1 time in total
|
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 7834 Location: Stratford, Ontario
|
Posted: Wed 16 Jan 2013, 19:07 Post subject:
|
|
What is the objective?
How about
| Code: | | ps -e | grep -io "ROX-Filer" |
|
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 2273 Location: Gatineau (Qc), Canada
|
Posted: Wed 16 Jan 2013, 19:25 Post subject:
|
|
Hi, rcrsn51.
Thanks. I'm trying to find the condition to launch or not a ROX panel. If the name of the panel can be listed with ps, I will do away with the dummy file I am currently using.
With the help of your idea, I suppose my line should now be this: | Code: | | ps f | grep -io "en-bas" |
("en-bas" being the very bland name of my ROX panel at the bottom of my screen and
"ps f" rather than "ps -e", because "f" displays a full line with all the parameters used by ROX-filer -- so we can discover if a ROX panel is active or not)
Only annoyance now is that "en-bas" appears twice. (hehe)
BFN.
musher0
_________________
"To err is human; to really foul things up, you need a computer!" / "L'erreur est humaine; pour vraiment f... la m..., il faut un ordinateur." (Carleton University, banderole à la Rentrée 1979 / banner, start of 1979 school year) 
|
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 7834 Location: Stratford, Ontario
|
Posted: Wed 16 Jan 2013, 19:28 Post subject:
|
|
| musher0 wrote: | | Only annoyance now is that "en-bas" appears twice. |
|
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 2273 Location: Gatineau (Qc), Canada
|
Posted: Wed 16 Jan 2013, 19:30 Post subject:
|
|
Gee, you're quick!
So, efficient line is : | Code: | | ps f | grep -iom 1 "en-bas" |
Many thanks!
musher0
_________________
"To err is human; to really foul things up, you need a computer!" / "L'erreur est humaine; pour vraiment f... la m..., il faut un ordinateur." (Carleton University, banderole à la Rentrée 1979 / banner, start of 1979 school year) 
|
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 2273 Location: Gatineau (Qc), Canada
|
Posted: Mon 21 Jan 2013, 19:17 Post subject:
|
|
Hello again.
Perhaps I marked [SOLVED] a little soon.
The ps command does not diagnose ROX-Filer fully.
The telling file is /root/.config/rox.sourceforge.net/ROX-Filer/panels.
(Thanks to "some1" for reminding me.)
So we use that file instead. The following works well:
| Code: | #!/bin/sh
# /root/my-applications/bin/barre-bas.sh
# Cacher ou afficher une barre ROX en bas de l'écran.
# Hide or display a ROX panel at the bottom of the screen.
# musher0, 17 janv. 2013.
####
cd /root/.config/rox.sourceforge.net/ROX-Filer
[ "`grep -iom 1 \"en-bas\" panels`" == "en-bas" ] && rox -b= || rox -b=en-bas &
# (Pour la commodité de la chose, on peut mettre un icone servant de commutateur sur l'écran.)
# (For ease of use, we can put a switch icon on the screen.) |
TWYL
musher0
_________________
"To err is human; to really foul things up, you need a computer!" / "L'erreur est humaine; pour vraiment f... la m..., il faut un ordinateur." (Carleton University, banderole à la Rentrée 1979 / banner, start of 1979 school year) 
|
|
Back to top
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|