Errors when Run


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Errors when Run
# 1  
Old 05-04-2012
Errors when Run

Hello,

So here is what i have

Code:
head -3 $1 > "$HOME/tmp/interchange_hold"
tail --lines=+4 $1 > "$HOME/tmp/no_int_file_hold"
tail -2 $HOME/tmp/no_int_file_hold > "$HOME/tmp/end_hold"
head --lines=-2 $HOME/tmp/no_int_file_hold > "$HOME/tmp/rawfile_hold"
cp "$HOME/tmp/end_hold" "$HOME/tmp/end_hold_cc"
cp "$HOME/tmp/rawfile_hold" "$HOME/tmp/rawfile_hold_cc"
cp "$HOME/tmp/interchange_hold" "$HOME/tmp/interchange_hold_cc"

delim=`cat $HOME/tmp/interchange_hold | head -1 | cut -b4`
num=`cat $HOME/tmp/end_hold |head -1 | awk -F "$delim" '{ print $3}'`


When running the script, i get these errors


Code:
Usage: tail [-f] [-b number] [file]
       tail [-f] [-c number] [file]
       tail [-f] [-n number] [file]
Obsolescent usage: tail [+-[n][l|b|c]] [-f] [file]
head: illegal option -- -
head: illegal option -- i
es=-2: Badly formed number

Any help would be greatly appreciated

Last edited by Corona688; 05-04-2012 at 06:58 PM..
# 2  
Old 05-04-2012
What's your system? You may be running on a system that doesn't have --long-style options.
# 3  
Old 05-04-2012
Quote:
tail --lines=+4 $1 > "$HOME/tmp/no_int_file_hold"

head --lines=-2 $HOME/tmp/no_int_file_hold > "$HOME/tmp/rawfile_hold"
Please explain in words what you would like the commands to do. It is hard to guess from syntactically incorrect code.

Please post your Operating System and version and what Shell you are using.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

2. UNIX for Dummies Questions & Answers

Scripts can be run manually but couldn't run with cronjobs

I am from MQ/MB technology. My requirement is to display the queue manger and broker status on daily basis. If I manually run the script, it works fine and displays output. But when I have scheduled the same using cronjobs it shows only the queue manger status and not the broker status. Can... (3 Replies)
Discussion started by: Anusha M
3 Replies

3. Shell Programming and Scripting

Script fails to run properly when run from CRONTAB

Hello all, I'm trying to write a script to gather and send data and it works just fine at the bash command line, but when executing from CRON, it does not run properly. My scripting skills are pretty limited and there's probably a better way, but as I said it works at the command line, but... (12 Replies)
Discussion started by: rusman
12 Replies

4. Shell Programming and Scripting

how to run an already made script run against a list of ip addresses solaris 8 question

how to run an already developed script run against a list of ip addresses solaris 8 question. the script goes away and check traffic information, for example check_GE-VLANStats-P3 1.1.1.1 and returns the results ok. how do I run this against an ip list? i.e a list of 30 ip addresses (26 Replies)
Discussion started by: llcooljatt
26 Replies

5. Shell Programming and Scripting

Ispell Script Run Errors

I am going to get straight to the point. I am writing a script that acts as a simple spell checker using ispell. This script makes a list of mispelled words and prompts the user if he or she would like to correct the word or type in there corrections. When I run the script it does not read the list... (5 Replies)
Discussion started by: Boltftw
5 Replies

6. AIX

My script didn't run every run every minute at cronjob

In my cronjob, I would like to schedule my script.sh to run every minutes. I crontab -e and have in line below but it didn't seems to run at all. * * * * * script.sh When I run it manually, I can run it. Is that anything wrong with the above line? If I change it to something like below,... (4 Replies)
Discussion started by: ngaisteve1
4 Replies

7. UNIX for Dummies Questions & Answers

Major OS errors/Bash errors help!!!!

Hi all, dummy here.... I have major errors on entering the shell. On login I get: -bash: dircolors: command not found -bash: tr: command not found -bash: fgrep: command not found -bash: grep: command not found -bash: grep: command not found -bash: id: command not found -bash: [: =: unary... (12 Replies)
Discussion started by: wcmmlynn
12 Replies

8. UNIX for Advanced & Expert Users

script to run different shells which run different processes

Hi, Would like to ask the experts if anyone knows how to run a script like this: dtterm -title shell1 run process1 on shell1 dtterm -title shell2 run process2 on shell2 cheers! p/s: sorry if i used the wrong forum, quite concussed after watching world cup for several nights; but I... (2 Replies)
Discussion started by: mochi
2 Replies

9. AIX

Adapter Errors and Link Errors

$ errpt | more IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION 3074FEB7 0802050205 T H fscsi1 ADAPTER ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR 3074FEB7 0802050205 T H fscsi0 ADAPTER ERROR B8113DD1 ... (2 Replies)
Discussion started by: mcastill66
2 Replies

10. UNIX for Advanced & Expert Users

Adapter Errors and Link Errors

$ errpt | more IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION 3074FEB7 0802050205 T H fscsi1 ADAPTER ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR 3074FEB7 0802050205 T H fscsi0 ADAPTER ERROR B8113DD1 ... (0 Replies)
Discussion started by: mcastill66
0 Replies
Login or Register to Ask a Question