LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-26-2018, 09:14 AM   #16
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,717

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210

You want to pass the name of the file to the script using pipe?
Code:
echo "file" | myScript.sh
Or am I missing something?

Last edited by scasey; 02-26-2018 at 10:45 AM.
 
Old 02-27-2018, 05:32 AM   #17
gigiux
LQ Newbie
 
Registered: Feb 2018
Posts: 19

Original Poster
Rep: Reputation: Disabled
pan64, can you explain more in detail? Tx
 
Old 02-27-2018, 05:36 AM   #18
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,775

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
what?
If you won't post your script I cannot tell you what should be modified.....
 
Old 02-27-2018, 05:50 AM   #19
gigiux
LQ Newbie
 
Registered: Feb 2018
Posts: 19

Original Poster
Rep: Reputation: Disabled
pan64, you wrote "use - as filename"; what do you mean? as for the code, as I said, the grep function is written as _grep -n '#' $inFile | cut -d':' -f 1_ where $inFile takes the value of 'file' when executed as _./myScript.sh file_
 
Old 02-27-2018, 06:00 AM   #20
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,775

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
"use - as filename" means: "use - as filename". see man grep about it.
Code:
DESCRIPTION
       grep  searches  the  named  input FILEs (or standard input if no files are named, or if a single hyphen-minus (-) is given as file name)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash hangs on tee(1) in pipeline shubert_doug AIX 3 12-18-2013 09:55 AM
[SOLVED] Loop through list of URLs in txt file, parse out parameters, pass to wget in bash. dchol Linux - Newbie 16 07-27-2011 02:19 PM
how to pipeline when the file requires two command line args???? lemon09 Programming 4 01-19-2010 09:24 PM
List all alternatives to encrypt data (for bash /pipeline)? frenchn00b Programming 0 01-06-2009 09:48 AM
how to pass a keystroke to a bash script? minike Programming 5 01-21-2007 11:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration