09-22-2003
Are you trying to pull the content from myfile such as:
awk -F: '{print $1}' myfile
Are you looking output $1 into another file and then use that file as the input of your Perl script? If so, I think that you should be able to:
awk -F: '{print $1}' myfile >> $INPUT
Right? I am still rusty so I am asking as well. Sorry if I am not much help.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
How to embeded programme within perl programme.
Shankarao (2 Replies)
Discussion started by: shankarao
2 Replies
2. Shell Programming and Scripting
Hi all,
I'm trying to define an alias with an embeded awk command:
alias kpipe='kill `psme| grep "ifw -r" | grep -v "grep ifw -r"| awk '{print $2}'`'
The problem is that the awk command (awk '{print $2}') contains two ' ..' quotes. So bash assumes that the first awk quote corresponds to... (5 Replies)
Discussion started by: jfortes
5 Replies
3. Shell Programming and Scripting
$ echo $(tty|sed 's#/*/##')
pts/0
$ who | grep $(tty|sed 's#/*/##')
grep: 0652-033 Cannot open 0551-011.
grep: 0652-033 Cannot open Standard.
grep: 0652-033 Cannot open input.
grep: 0652-033 Cannot open is.
grep: 0652-033 Cannot open not.
grep: 0652-033 Cannot open a.
grep: 0652-033 Cannot... (2 Replies)
Discussion started by: wrl
2 Replies
4. Shell Programming and Scripting
hi all
I am new to awk/perl I would appreciate it if you could help!
how do I read a sub folder and their files.
e.g. simulation/10ms/router1.dat, router2.dat,..., router16.dat
simulation/100ms/router1.dat, router2.dat,..., router16.dat
simulation/300ms/router1.dat,... (14 Replies)
Discussion started by: mmoses
14 Replies
5. Shell Programming and Scripting
I have a script to get server information i wrote in perl because i would like to learn it (and I use it for work). It works great, however i would like to know if there is a good way to reduce the following line.
Sean (6 Replies)
Discussion started by: insania
6 Replies
6. Shell Programming and Scripting
awk -F "|" '{print $2$3$4 upto $30}' file1 > file2
Same logic, i want to write it in perl
I tried
#!/bin/usr/perl
my $line;
open FH, "<file1" or die " Can't open file $!";
open FH1, ">file2" or die "Can't open file ";
while (<FH1>){
$line = (split /\|/,$_);
print FH2 $line;... (3 Replies)
Discussion started by: pritish.sas
3 Replies
7. Shell Programming and Scripting
DEAR ALL,
i am using following command to fetch some records from more then 50000 files... command is taking more time ....
can i have perl command for the same...( i am New to perl )
awk -F "|" '{ if($4==3244898 && $5==5000185) print $66}' *.DATA (2 Replies)
Discussion started by: arvindng
2 Replies
8. Programming
hi
i have an error in script language when run it
i use python 2.4, CentOS 5.5, Qt C++ 2010/04
the error is
SystemError: null argument to internal routine
the Python Code
def main(i):
print i
if __name__ == "__main__":
main(i)
the C++ Code
PyObject *objModule =... (0 Replies)
Discussion started by: HanyM.Magdy
0 Replies
9. Shell Programming and Scripting
Hello,
I know this is a situation about the single quote and double literal, but I could not figure out after many search.
I need to loop through thousands of different BACs sequencing to optimize kmer individually.
IN=/PATH/TO/INPUT/FILES
for sample in S{01..1096}
do
run_program... (9 Replies)
Discussion started by: yifangt
9 Replies
10. UNIX for Beginners Questions & Answers
Hello. I'm currently teaching myself Perl and was trying to turn an awk code that I had written into Perl. I have gotten stuck on a particular part and a2p has not helped me at all. The task was to take a .csv file containing a name, assignment type, score and points possible and compute it into a... (1 Reply)
Discussion started by: Eric7giants
1 Replies
LEARN ABOUT DEBIAN
shunit2
SHUNIT2(1) SHUNIT2(1)
NAME
shunit2 - A unit test framework for shell scripts
SYNOPSIS
shunit2 unitfile
DESCRIPTION
shUnit2 is a xUnit unit test framework for Bourne based shell scripts, and it is designed to work in a similar manner to JUnit, PyUnit,
etc.. If you have ever had the desire to write a unit test for a shell script, shUnit2 can do the job.
You can either run shunit2 directly from the commandline and specify the unit file or directly source the shunit2 executable.
If you directly execute shunit2 and don't specify a unitfile shunit2 assumes a empty testfile and will return without an error message.
EXAMPLE
Simple script to test if 1 equals 1
#! /bin/sh
testEquality()
{
assertEquals 1 1
}
# load shunit2
. shunit2
Execute shUnit2 unit tests directly from the commandline
shunit2 /path/to/unit/file
OPTIONS
shunit2 does not support any commandline options at all. You can either source shunit2 to execute your unit tests or directly run shunit2
as a commandline script.
SEE ALSO
For more information see http://code.google.com/p/shunit2/ or have a look at the installed documentation in /usr/share/doc/shunit2/
AUTHOR
shunit2 was written by Kate Ward <kate.ward@forestent.com>. This manpage was written by Ulrich Dangel <mru@spamt.net>.
2.1.6 03/25/2012 SHUNIT2(1)