![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| If conditional | abhinavsinha | UNIX for Dummies Questions & Answers | 1 | 10-31-2008 01:48 AM |
| Awk Conditional | icy_blu_blu | Shell Programming and Scripting | 3 | 07-18-2008 02:34 AM |
| Conditional FTP | Dastard | Shell Programming and Scripting | 2 | 06-21-2008 08:38 AM |
| conditional ftp | dr46014 | UNIX for Dummies Questions & Answers | 3 | 06-20-2008 12:00 PM |
| AWK - conditional cause | Rafael.Buria | Shell Programming and Scripting | 2 | 01-28-2008 01:24 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
If conditional
Hi,
I am new to unix and shell scripting.In my script,there is a line using the "if" conditional - if [$x != "," ] && [$x != ","]; then do something Here "x" is a variable holding string value.If it is not equal to a comma or a string,only then I want to enter the "if" loop. But I am getting error while running this. The error says - " != Expecting unary operator" . Please let me know what is wrong and how to correct it. |
|
||||
|
There is one more question. I have a string(suppose $str). If it starts with a comma(there can be more than one comma at the start),I have to remove all the commas from the beginning.So i have to check if the string starts with a comma.If it does,I have to delete all the commas which are at the start of the string.Please help.
|
|
||||
|
Thanks for your reply.But what I need is,I want to delete starting commas from the variable (say $str) and the changes should be made to the original variable so that when I access $str the next time,the starting commas are not there.Please help.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|