The following perl statement in a bash script consists of two substatements. I intend the first perl substatement (the assignment with glob) to get input from the preceding bash pipe, and the second perl substatement (the foreach loop) to output back to bash. However, the first perl substatement undesirably outputs back to bash in addition to the desirable output from the second perl substatement. I want only the second perl substatement to output back to bash. Please show me how to prevent the first perl substatement from outputting to bash.
The perl statement consists of
my @vAry = glob
and
foreach my $i (@vAry) {print "$i\n";}
The output from the first perl substatement is
bb cc dd
The output from the second perl substatement is
bb
cc
dd
I would like the entire perl statement to output the following.
bb
cc
dd
However, the actual output from the entire perl statement is
bb
cc
dd
bb cc dd
How can one suppress the output from the first perl substatement?
Many thanks in advance.
Update:
This question has been successfully answered by Post#8 by durden_tyler.
I have a file that look like this:
>Muestra-1
agctgcgagctgcgaccc
gggttatata
ggaagagacacacacaccccc
>Muestra-2
agctgcg
agctgcgacccgggttatataggaagagac
acacacaccccc
>Muestra-3
agctgcgagctgcgaccc
gggttatata
ggaagagacacacacaccccc
I use the following sed script to remove newlines from... (2 Replies)
Dear All
I have a text file which has many columns (>10,000). I want to create a new text file which will NOT include following columns: 5,15,105,200. How can I do that in shell (or awk, perl)? Thanks. (6 Replies)
Hi, guys, i have a script i inherited from a coworker but i'm not perl savy. The script works but i would like it to work better. I want to run this command
./ciscomgrtest.pl -r "show version" -h hosts.router
and have the script goto each router in the hosts.router file and run the command... (2 Replies)
I have two files, these have to be selectively merged into two other files. In addition there will require to be a edit to the last field, where the date format is changed.
The first file is a csv file with around 300k lines the data is now nearly 20 years old and I have been asked to move this... (7 Replies)
Hi,
I have a text as below
test1 test2 test3\
test4 test5 test6 test7
newtest1 newtest2\
newtest3 newtest4 newtest5
And need this to be replaces to
test1 test2 test3 test4 test5 test6 test7
newtest1 newtest2 newtest3 newtest4 newtest5
So my requirement is to remove the EOL... (5 Replies)
Hi All,
I just wanted to know, is there a way to suppress the output of the following i.e. the output should not be written on the screen:
ping 10.1.23.234 -n 1
PING 10.1.23.234: 64 byte packets
64 bytes from 10.1.23.234: icmp_seq=0. time=0. ms
----10.1.23.234 PING Statistics----
1... (2 Replies)
I have to stop the output of dd from writing to terminal. Here is the command:
sudo dd if=boot1h of="/dev/r$temp1"
Here is the output:
2+0 records in
2+0 records out
1024 bytes transferred in 0.000804 secs (1273715 bytes/sec)
I have tried >> log.txt but it doesn't work. Is there... (4 Replies)
i run history command and I want to eliminate the list number.
So far this perl script works as long as the list is a exact 3 character
long.
cat dd | perl -pe 's,\d{3},,'
70 export JAVA_HOME=.
81 export JAVA_HOME=.
82 export JAVA_HOME=`pwd`
export JAVA_HOME=`pwd`
... (1 Reply)
Hi all,
I have this doubt as to whether we can selective mount FS .by taking the input from the vfstab?
ie, suppose i want to mount tmpfs(actually i want to do it :))but i dont want to follow the conventional way through the script that actually does!!
However i want to just collect that... (0 Replies)
Hello,
I am new to db2 SQL in unix so bear with me while I try to explain the situation. I have a text file that has the contents of the where condition that I am using for a db2 SQL in UNIX ksh.
Here is the snippet.
if ;
then
echo "Begin processing VALUEs"
... (1 Reply)