all this files and thosands more in /test/test2
to get my file I should give some parameter " in this example I give 2 gre some time it will take more than 6 grep's to get what I want " forget it "
--------------------------------------------------
ls -lrt | grep "Apr 10" | grep 1998 | lp
I will get the printe of result not the file it self...Pleassse try to understand me and execuse me for my "GOOD" english
Better to read all what I wrote above or just read this
[ HOW I CAN PRINT THE RESULTED FILES AS A FILE NOT AS OUTPUT ]
ok I will get the result in result.txt as u said then I want to print the files, don't tell me to print result.txt coz I will get in name of the file in the print out and I want to print the information inside the file.It's very simple please don't make me feel my english toooo BAD & unix As well
what I want is the fastest way to print multipul files
Please please read this carefully and try it out before deciding it won't work, because as far as I can tell, it will!
I think that if you can figure out exactly what you are needing to do (which files to print, and when), you could use a very simple find command to do it.
But if you really really really want to use grep a bunch of times, you could do this:
or use: Note: I used backticks ` not single quotes ' above. The backticks are usually near the top left on a standard PC keyboard.
Or like this (if you can narrow what you want down by the filename):
Or what about :
Some of these may complain of an error with too many arguments, or possibly that the jobs may not all print, so you may have to use the first/second idea of:
These examples all assume you are using a Bourne shell variant, such as ksh, sh, bash, etc...
Please try these before posting back saying that none of them work. And please let us know why they don't work.
Or even the basic step of taking the file.txt and adding print in the beginning of each line in the file and making it exe.
I know this is horrible scripting, but it works.
I agree that one of Livinfree's suggestions will work. see below his code.
code:
--------------------------------------------------------------------------------
for each in `cat /tmp/lp_file`; do print $each; done
--------------------------------------------------------------------------------
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Hi
Is it possible to get the below code working.?
cmd="grep 'Name:' |awk -F' ' '{print $2}'|xargs -i basename {}"
echo $cmd
(
rman target / <<EOF1
LIST COPY ;
exit
EOF1
) | `$cmd`
in nutshell I want to be able to preset cmd as depending on script flow it can be... (2 Replies)
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
Hi all,
can any one suggest me the script to grep multiple strings from ps -ef
pls correct the below script . its not working/
i want to print OK if all the below process are running in my solaris system. else i want to print NOT OK.
bash-3.00$ ps -ef | grep blu
lscpusr 48 42 ... (11 Replies)
Hi all,
First off, sorry for a long post but I think I have no other option if I need to explain properly what I need help for.
I need some advise on how best to check for "faulty" or "stalled/jammed' print queues. At the moment, I have three (3) application servers which also acts as print... (0 Replies)
Hi Guys,
I need to set the value of $7 to zero in case $7 is NULL. I've tried the below command but doesn't work. Any ideas. thanks guys.
MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else { print $7}}' `
Harby. (4 Replies)
Hi,
I don't know hot to make this command work:
ls -laR | grep "^-" | awk '{print $9}'| grep "$.txt"
It should return the list of file .txt
It's important to search .txt at the end of the line, becouse some file name have "txt" in their name but have other extensions (13 Replies)
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)