piping to 'open' command!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting piping to 'open' command!
# 1  
Old 02-02-2011
piping to 'open' command! [solved: xargs]

Hello!

One command generates a file path, which I then want to open in finder. The slow way is this with C&P:

Code:
$bundle show jquery-validator
/Users/peter/.rvm/gems/ruby-1.9.2-p136/gems/jquery-validator-0.3.0
$open /Users/peter/.rvm/gems/ruby-1.9.2-p136/gems/jquery-validator-0.3.0

I would like to use pipe, but the only way in the docs is the -f flag, which instead puts the path in to a /tmp text file, and opens the text file.

Thoughts? Thanks!

Last edited by pehrlich; 02-02-2011 at 09:00 PM..
# 2  
Old 02-02-2011
I don't know about command called "show" or "open". But if I understand your question here is the same thing using "expr" and "echo"...
Code:
$ expr 1 + 1
2
$ echo 2
2
$ expr 1 + 1 | xargs echo
2
$

# 3  
Old 02-02-2011
I am at a loss, java plugins for html in shell. You can run anything and pipe the output on stdout to stdin of the next command. What that achieves depends on the two commands.
# 4  
Old 02-02-2011
Perderabo: beautiful!! This does the trick. Thank you much!!
Code:
bundle show jquery-validator | xargs open


DGPickett: not sure what's got you all upset. I for one am not seeing any html in my shell.. (and as I mentioned, pipe doesn't do what's desired).
# 5  
Old 02-03-2011
Just confused, not familar with bundle or open! I recommend "xargs -n999", as without -n, xargs will run open for 0 lines.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Piping the "script" command through the logger command.

I use the snippet below in /etc/profile on RHEL Linux to capture command line logging and it all works well and good. Now I'd like to pipe the same output from script through the logger command so it all gets logged to syslog. The only additional code I've added is in bold below (|... (4 Replies)
Discussion started by: woodson2
4 Replies

2. Shell Programming and Scripting

Open command

Hi , what does this below commands do in perl ? open(fd, ">>$received_notification_file"); print fd "$feed_name,,,$feed_expected_ind,$received_ind,$copied_ind,$market_pricing_dt\n"; close(fd); also this $tmp_file_Ctrl = "$Program.tempfileC_$feed_name" ; ... (1 Reply)
Discussion started by: ptappeta
1 Replies

3. Shell Programming and Scripting

Abnormality while piping tr command output to sed

i have a file seperated each line seperated by newline. For example alpha beta gamma i am trying to replace the newlines to "," but dont want , present at the end of the line so i am trying the below one liner . but not sure whats wrong but its not working cat myfile | tr -s '\n' ',' | sed... (9 Replies)
Discussion started by: chidori
9 Replies

4. Shell Programming and Scripting

Syntax error piping to bc on command line - works when assigned to var

I have a script which outputs some timing data a line at a time. There are approx. 10 lines echoed, each line looks something like this: 0.741 http://checkip.dyndns.org 94.170.119.226Since I needed to add all the values in the first column, I piped the output to grep, matching and printing the... (7 Replies)
Discussion started by: gencon
7 Replies

5. Shell Programming and Scripting

Piping output from a command into bash script

Hi all. I am using procmail to deliver an email to a script I am developing. Procmail delivers the email to the script on standard input. I imagine this is the same as piping input from a command into the script. Hence I've been testing my script by running echo 'test' | sms-autosend-backup.sh ... (2 Replies)
Discussion started by: akindo
2 Replies

6. Shell Programming and Scripting

KSH script: piping passes command-line arguments

Dear forum I have the following small script: #!/bin/ksh echo -e "abba-o" | awk -F '-' '{ print $2 }' | cut -b 1It needs to be ksh.. in bash I don't have this problem. If I run this on opensuse 10.2 I get this as output: e If I run this on suse enterprise 10 sp2 then I get this: o ... (1 Reply)
Discussion started by: gemtry
1 Replies

7. UNIX for Dummies Questions & Answers

echo command and piping

Hi, I have heard you can use the echo command and piping together and was wondering if you can help me out. I want to be able to use the echo command and pipe together to tell me how many files are in my current working directory, which have only my username read, write and execute... (4 Replies)
Discussion started by: rushhour
4 Replies

8. UNIX for Dummies Questions & Answers

use of xargs and prune piping with find command.

Can anyone interpret and tell me the way the below command works? find * -name "*${msgType}" -mtime +${archiveDays} -prune -type f -print 2>/dev/null | xargs rm -f 2> /dev/null Please tell me the usage of prune and xargs in the above command? Looking forward your reply. Thanks in... (1 Reply)
Discussion started by: venkatesht
1 Replies

9. UNIX for Dummies Questions & Answers

piping the output of find command to grep

Hi, I did not understand why the following did not work out as I expected: find . -name "pqp.txt" | grep -v "Permission" I thought I would be able to catch whichever paths containing my pqp.txt file without receiving the display of messages such as "find: cannot access... Permisson... (1 Reply)
Discussion started by: 435 Gavea
1 Replies

10. UNIX for Dummies Questions & Answers

piping with javac command

how to i use javac on a file after searching for it? example: find . -name '*.java' -size -24 -links -2 -atime -4 what would happen if "find" found >1 .java files? also, i'm a little confused on the -size property... mix up between -2 and +2... what's the difference? (1 Reply)
Discussion started by: quipy
1 Replies
Login or Register to Ask a Question