Please post the current version of the script and any error messages verbatim.
Please post the O/S version, blotting anything confidential with X's,
Well spotted Scrutinizer. My cut doesn't misbehave if the parameters are in the wrong order and an example in man cut has the -d before the -f .
Since the order is explicit in the synopsis, I suspect there must have been some historical implementations that were picky about the order. I don't recall coming across one, but since the error message explicitly says:
I am guessing this is what this particular implementation wants to see first..
This User Gave Thanks to Scrutinizer For This Post:
I cut-and-pasted some of the code and to my surprise the Unix "cut"-command was giving me a similar error. Things looked kinda spooky for a moment:
Then this is what set -x showed:
And this is what od -c showed:
So my guess is the OP has not been using a regular ASCII editor to produce his code...
This User Gave Thanks to Scrutinizer For This Post:
@Scrutinizer
I can't reproduce that effect. Perhaps your own computer or the O/P's is using Unicode not ASCII and my cut/paste is correcting the character? Or, as you suggest the O/P has used a non-unix editor.
The O/P could try editing the script with unix vi (or vim) and retyping the whole line.
The cut with Berkeley unix was a but sensitive to syntax, and we don't know what O/S we have here.
Might be worth trying space characters in the command line as well as following the strict field order:
Right now, if I cut and paste this:
I do not get the error.
If I cut-and-paste this:
I do get the error.
I have tried this on both OSX and Linux, using a Linux computer, a Mac and a Windows computer as intermediary. If I cut and paste the OP's original post into a here document that I run through od -c , I get the same thing...
This User Gave Thanks to Scrutinizer For This Post:
1) I originally did the cut/paste with IE8 into Reflections 14 telnet which somehow sorted the mess and gave me the correct character.
2) Now if I use IE8 and Microsoft telnet on XP and cut/paste into vi all the funny characters are stripped. I then ran diff to see how different they were.
3) If I use IE8 and cut/paste into Windows Notepad on XP all the funny characters become visible. It's not just the hyphen in the first cut, there are some sloping quotes too. If I then transfer the Notepad version to unix with text file FTP the bad characters are still there.
The script is riddled with them.
Advice to O/P is to edit the script with vi or vim and correct all the strange characters. The script has almost certainly been edited with a Microsoft Windows editor not a unix editor and it contains characters from a different character set which are causing the script to fail. If the script was not transferred to the unix server with text file ftp, it will probably also have a spurious ^M (carriage return) character at the end of each line which must be removed.
Hi, i am new in shell script. i have given a task to make a C-shell script. I have list of ip address and device name respectively. For example;
cal 1 : 100.21.25.10
cal 2 : 100.21.25.11
cal 3 : 100.21.25.12
cal 4 : 100.21.25.14
and so on...
Right now, i have this.
#! /bin/csh -f
... (0 Replies)
i have a query on checking Tru64 disk drives physical capacity.
i used hwmgr view devices and saw this disk.
160: /dev/disk/dsk7c COMPAQ BF03688284 bus-3-targ-0-lun-0
checking the model on the internet shows it is a 36.4GB drive.
i checked the disk details and saw the... (2 Replies)
Hello.. I wrote the following shell script to run disk quotas for assigning limits to users. I need to know the partition which the user has created and mount it. So i copied the partitions (which will be displayed after running fdisk -l) and separted the last line from it and cut the required... (0 Replies)
Hi Guys,
I'm a newb at shell scripting and successfully attempted a small disk space script (victory!!) but i'm wondering whether it actually takes into consideration KB,MB,GB. Please take a look at the script and advise.
##script to check if file sys has reached threshold.
... (3 Replies)
Hi all,
I am new to Unix and I want to write a shell script in a jumpbox for finding the filesystem capacity on 50 unix servers ( by ssh ) and then email the result in HTML format with server name and capacity % to a specific outlook distribution list.
any suggestion would be of great help. (17 Replies)
Hi,
I would like to know how to find out disk capacity if it is assigned from the storage as a lun.
as per below command , I am unable to find out disk capacity.
$ bash
bash-3.00$ lspv
hdisk1 0001579a7fa3c086 None
$ lscfg -vl hdisk1
hdisk1 ... (8 Replies)
friends , need a shell script to create a disk load. can any one pls guide me with how this can be implemented. Pls provide the concept. from there i will try to design my script. (3 Replies)
Hi, Im getting a downtime of 4 hrs to do porting of bootdisks.
Currently, the system is running on Sf4800. 2 internal disk 36G connected to a SE3510 storage.
We're getting 72G disks and we want to restore the OS from the current 36G to the 72G disk. System is under veritas volume manager ctrl.... (4 Replies)
Is there any danger to keeping one of my disks at 100% capacity? (it's a disk just used for read-only files, not system files or anything like that).
It's HP-UX if that matters.
Thanks! (1 Reply)