Depends on Machine?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Depends on Machine?
# 1  
Old 08-11-2007
Depends on Machine?

I am trying to learn PERL programming. I copied this example from a book just to try it on my machine. It worked out fine but when I tried it on another machine, an error appears: syntax error near unexpected token ';'.
I tried it on a third machine but a new error appears: command not found.

Here is the scipt:

#!/usr/local/bin/perl
system "clear \n";
print "\nPractice Only:\n";
$inputline = <STDIN>;
system "clear \n";
print"\n\n\n";
print( $inputline );

The work station is sunOS.

I don't what's the difference between the machines.
# 2  
Old 08-11-2007
check your path to your perl interpreter...

# which perl
# 3  
Old 08-11-2007
The script is the same on all the 3 machines and the perl location is also the same (path - which perl).
# 4  
Old 08-11-2007
Quote:
Originally Posted by Slick
I tried it on a third machine but a new error appears: command not found.
On the third machine, try executing "clear" from the command line. It is probably not in $PATH or not on the machine.
# 5  
Old 08-12-2007
Quote:
Originally Posted by Slick
system "clear \n";
Why the tailing newline?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Result of nmap depends of mac address

Hi guys, i am having some mine bash script which print only ip addresses echo "Interfaces IP addresses:" ip -o addr | awk '!/^*: ?lo|link\/ether/ {print $2" "$4}' echo -n "enter range of IPs(192.168.0.1-254): " read range nmap -oG - $range >/home/test/Desktop/SCAN cat... (0 Replies)
Discussion started by: tomislav91
0 Replies

2. Shell Programming and Scripting

While loop depends on variable

The variable N is set upon start of script so while loop runs and keeps running because N is not being updated when loop is running: N becomes less than 9 but it still runs (should be "done").... Any ideas? Thanks! N=`wc -l /home/count.txt | awk '{print $1}'` while test "$N" -gt "10"... (10 Replies)
Discussion started by: holyearth
10 Replies

3. Shell Programming and Scripting

How to transfer files from unix machine to local machine using shell script?

Hi All.. Am new to Unix!! Am creating a shell script in which a scenario is like i have transfer the output file from unix machine (Server) to local directory (Windows xp). And also i have to transfer the input file from the local directory to Unix machine (Server) Any help from you... (1 Reply)
Discussion started by: vidhyaS
1 Replies

4. Programming

Valgrind Error : Conditional jump or move depends on uninitialised value(s)

Hi Friends, I am using valgrind, to check errors, there are no errors in my code but this the output put i get, i need to suppress these errors, please help me do so... Conditional jump or move depends on uninitialised value(s) ==2350== at 0x400AF0F: (within /lib/ld-2.11.1.so)... (0 Replies)
Discussion started by: niranjanvg
0 Replies

5. UNIX for Dummies Questions & Answers

valgrind Conditional jump or move depends on uninitialised value(s)

Hi, I know similar questions appeared here already, still i didnt find answer to my problem yet. Im getting the following message from valgrind (version 2): ==15414== 1 errors in context 1 of 6: ==15414== Conditional jump or move depends on uninitialised value(s) ==15414== at... (2 Replies)
Discussion started by: evasz
2 Replies

6. Red Hat

To find the LATEST file from a dir on REMOTE machine and SCP to local machine?

Hi All, URGENT - Please help me form a scipt for this: I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server) I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Discussion started by: me_ub
3 Replies

7. Programming

valgrind (Conditional jump or move depends on uninitialised value(s))

Hi everybody, I wrote a small subroutine 'GetStringDelim()' to return a substring from a string enclosed by a string 'Limit1' and a char 'Limit2'. It works perfectly and I don't get an error message together with valgrind, if I set the 3rd parameter in GetStringDelim() to NULL (see below). ... (3 Replies)
Discussion started by: MIB_Maik
3 Replies

8. UNIX for Dummies Questions & Answers

Please Help:Need to Split the file into mutliple files depends on the KEY field value

Hi Gurus, I am new to UNIX(HP). my requirmnet is File needs to needs to be split into multiple files dependa on one key value. example 1 abc 333 us 2 bbc 444 ch 5 nnn 333 kk 7 hhh 555 ll 3 hhh 333 hh now the requirment is line with 333 should be copied into test1.txt and... (14 Replies)
Discussion started by: arund_01
14 Replies

9. Shell Programming and Scripting

Please my job depends on this ....

I need to write a script that will move files from a direcory to another directory, but only the files that are owned by a specific owner. e.g. if seven files in a dir are owner by a user called 'budd' then move to a direcory called \budd. If not then leave alone. Many Thanks (2 Replies)
Discussion started by: Budd
2 Replies
Login or Register to Ask a Question