i named my script as testing.pl. But i am still seeing errors, pls advise.
Ran the code by typing testing.pl. Error encountered below $ testing.pl
bash: testing.pl: command not found
Ran the code by typing perl testing.pl. Error encountered below. $ perl testing.pl
String found where operator expected at testing.pl line 2, near "lane 'if (/ddd/
) { print $F[2] }'"
(Do you need to predeclare lane?)
Bareword found where operator expected at testing.pl line 2, near "'if (/ddd/) {
print $F[2] }' textfile"
(Missing operator before textfile?)
syntax error at testing.pl line 2, near "lane 'if (/ddd/) { print $F[2] }'"
Execution of testing.pl aborted due to compilation errors.
Ran the code by typing testing.pl. Error encountered below
$ testing.pl
bash: testing.pl: command not found
Make sure testing.pl is in your $PATH
Ran the code by typing perl testing.pl. Error encountered below.
$ perl testing.pl
String found where operator expected at testing.pl line 2, near "lane 'if (/ddd/
) { print $F[2] }'"
(Do you need to predeclare lane?)
Bareword found where operator expected at testing.pl line 2, near "'if (/ddd/) {
print $F[2] }' textfile"
(Missing operator before textfile?)
syntax error at testing.pl line 2, near "lane 'if (/ddd/) { print $F[2] }'"
Execution of testing.pl aborted due to compilation errors.
As i told you earlier, it is one liner. As i indicated earlier , you can add code to that to perform your additional task.
test.pl $. contains current line number for the last filehandle accessed
I think your code would be more suitable for me. But this statement@split_arr = split(/ /, $_);, can you modify such that it will not care about the number of spaces in between the fields,and as long as there's a space between 2 terms,it wil split.
EG:
Input_file: aaa bbb ccc
ddd eee fff #notice the number of spaces before "fff" increases
hhhh pppp kkk jjjj
vvvv mm sss zzz
Output: fff
Hi,
I have a text file which looks like this
a.txt
A,12,Apple,Red
B,33,Banana,Yellow
C,66,Sky,Blue
I need to search for a particular field(s) in particular column(s) and for that matching line need to replace the nth column.
Sample scenario 1:
Search for 66 in second field and Sky in... (5 Replies)
I am trying to select a column using a search term.
My input file looks like this (tab delimited):
ABC BJS FDG GHH DGH DFG GHF
95 456 5 266 87 4567 67
3 54 678 4567 45 6 36
232 55 3 5 6 8 34
cat filename | awk '{print $2}'above code will give me the second column. However, what I want... (2 Replies)
I.m using qvt term to convert my windows xp laptop to work with sun ultra 5 unix system but i can't connect - my settings are off and i can't figure it out - i have a feeling it is my serial port # the porgramm is asking for. Can someone tell me where i can find this number. thanks Christine (9 Replies)
Hi,
I am trying the function killproc -term and it seems to be doing something extra that kill <pid> doesn't do. My daemon cleanly terminates using kill, but not using killproc.
I tried strace on killproc and then killproc works well. I read online that strace ignores SIGSTOP. does that mean... (4 Replies)
I'm using less to find terms in a 6 gb text file in OS X in the terminal. When I first search for the patter, it finds it, scrolls the document to the correct location, and highlights it. But when I search again, the document scrolls to a new further location (I'm assuming it's found the pattern... (2 Replies)
Hello All,
Background
========
I am creating a virtual appliance console for a software stack on VMware ESXi. I am using Centos 5.x as the Linux distro (Guest OS). I have created a ncurses based application that does the user authentication and present him with some basic controls to do basic... (2 Replies)
I am trying to amend an existing TERM script to prompt the end user for a password - then take that password and add it to a specific part of an existing file.
Here is what I have - BUT - I am confusing Unix with Term and my script does not like what I added b/c the script simply runs through... (1 Reply)
hi floks !
i'd like to know how can i transmete a character or a string from my source code to a term and make it interpret or un by the shell wich is running in my term.
I'd like to create a Term from my code (and get its file descriptor) and then transmete each char typed on the keyboard to... (1 Reply)
Hi Everyone,
I need some information from all of you guys.
I generally work on a Solaris OS in my school and I had heard that I can download something called X-Term on a Windows system and still work on some of the graphical things on windows which generally work only on unix.
This is what I... (5 Replies)