Friday, October 31, 2008

Two hours to the market closed today Oct 31

Well, some  problems to start with,. I was a bit late to wake up and found out that the market had jumped about 800 points early morning.

 

Bharti declared its reports for Q2 today. And also, there was one bank that declared its reports today. The banking sector overall has been doing great,

 

The Reliance Industries has jumped about 200 rs in the week that has passed.

 

This was one good valuation , but the market at 7000 was looking really bad as each passing day was full of surprises. Slowly I am giving up any hope on being able to find some pattern here. Though Mandlebrot graphs are suppose to near it, but then again, you will have to have the control and data of all the market data every minute,

 

Yesterday surprisingly though there was some business , finance.google and moneycontrol were both down interestingly. I will find more about it and paste it here

Wednesday, October 29, 2008

boy Laxman is taking ages to go

I am a little worried whether or not,he will make it to his 13th hundred in tests,

Laxman has been stuck at 99 for the last half an hour, This is where people start to like Sehwag

The 3:30 closing bell is now up

The market closed around the 9070 marks. I was afraid of this. Tomorrow the market will climb down as the day will proceed. Volatility will be there but the 8900 levels will be tested.

 

I will do a sectoral preview of the whole thing later in the day today. Back to office work ( salary makes me tick in the share market finally ) so have to keep the first lords happy

Whether the markets are getting played into

I think ,the next half an hour will be an important indicator, whether the markets are getting played into .

 

I have been following the last half an hour of the market for a long time. You can be a king if you know how to manipulate your calls during this half and hour,

 

You need to see the market all day, just sit at 2:30 do the analysis and be ready by 3:00 , given that volumes are high for the day. Still there are some calls we need to make seriously.

 

The market is standing at 9003 points now ( 3:10 in the afternoon ) , If it comes down to 8900 now, tomorrow will be a pretty stable day , but if it goes up, we may see some bad selling tomorrow morning

There is something black happening with the market

The volatility and the decoupling with the DOW is something funny. I did not expect it in a long time.

Yesterday the DOW went up by 1000 points almost. A very good day in the markets, and the Diwali mahurat trading saw a lot of good news in the making.

I was worried though, that the markets are getting played by someother factors and the decoupling from the world markets are bound to happen.

Even CNBC 18 , has been voicing this for a long time now, that the FII selling is found to be about 1100-1200 crores a day , where else the market is losing grounds.

Hyper selling is fine but the upmarket swings in exactly opposite days has made the predictability levels beyond the eyes of a mere speculator. I am of the school of thought now that there will be a large fall tomorrow

 

Currently it is 2:33 in the afternoon and the market after having 500 points ( near about that ) and crossing the 9000 mark is now back to the 8000 levels.

I think it will go back to 8500 levels by tomorrow.

 

Dow will be falling tonight if my predictions go correct

Tuesday, October 28, 2008

Mahurat trading

many domestic trading houses had anyway stopped trading on Diwali and mainly do a 100rs toke trading to appease the lady goddess of wealth in India.


This year , Vikram Samvat 2065, chances are bleak that we have any volume trading for the day. There was once an aura of auspicious ness for this hindu new year but with online brokerage and the platform shift from floor trading to other forms , it is now a call depending on FII investments mainly.

 

Though out of the last 7 year, 4 years we have seen some amount of rallying moving towards Diwali but the Financial new year in April 1 and January 1 the calendar new year has somehow taken the limelight from the Hindu new year in the stock market.

 

Number of foreign players riding the market seems to be the likely cause for the same.

 

Anyway, nothing much on the marketing side today , Was viewing a Diwali special on CNBC 18 with Udayan Mukherjee hosting the day for Rakesh Jhunjhuwala and Sameer Arora.

 

 

Sunday, October 26, 2008

So it looks like that my analysis was wrong

My scripts went berserk the other day and thank god I did not invest.

Today we are going down the spiral in the stock market, 500 points down Monday morning, Oct 27 2008.

I did not expect it to do so after the weekend where the NASDAQ futures looked pretty much ok

 

Japanese markets are doing pretty much ok, but Korea has already lost 12% as we speak.

 

Bank Of Baroda,

it is a sad thing that I know that so much money is sitting out there but I will not be able to make it.

 

For the Bank of Baroda , shares now confortably priced at 245. this is one of the banks that does not fluctuate much, I don’t know why, even though it has international presence. Some market research will show some extraordinary results.

NRI;s are throwing in their money in Indian banks, worried about the state of banks in the western countries. Thus BOB did declare a profit over the weekend for its Q2 results. I know that the share will open tomorrow at 260 .

 

This is about 6 % profit , if, some one were to take loan and invest about 2000000 lets say in the market, he  would be happily placed with 60K in hand by tomorrow morning. This is the power of money in the stock markets.

Sitting at home you could be reaping millions.

 

My scripts have become consistent and over the period of the next six months, without actually investing money in the market I will make calls rather sitting at home.

 

Just to see whether the scripts are doing fine

Saturday, October 25, 2008

Something interesting about the stock market crash of the 1929 s

I found this today while reading through some of the previous stock market crashes of the yesteryears

 

By the end of the week of November 11, the index stood at 228, a cumulative drop of 40 percent from the September high. The markets rallied in succeeding months but it would be a false recovery that led unsuspecting investors into the worst economic crisis of modern times. The Dow Jones Industrial Average would lose 89% of its value before finally bottoming out in July 1932.

 

 

Taken from Wiki pedia.

 

This is exactly what  I am fearing , I am worried that the following will happen in India too. Though Nasdaq is behaving rather strongly in the last week and things are pretty much towards an upturn for Nasdaq . The same cannot be predicted for the rest of the world markets. None of the senior analysts are pointing out anything in particular.

 

People like Udayan Mukherjee are moreover, seen asking , the Gujrals, and Shahs, the imminent questions.

I am of the thought that the worse is yet to come since the markets are just starting to react to the bad news in India,

Layoffs , cost cutting and other forms of deleveraging measures will soon come to play and there will be a reduction in Rupee movement in the next quarter. I am worried about the January end, stock situation, Since there will be some rallying definitely in November, but December end onwards there will be the start of the doomsday that everybody is afraid of.

I know as a country , we have far more regularizations in the market and the FIIs are just 30% of the stock market and they are not going to completeyly vanish out of the market . But there are high chances that there export based economy will suffer some irrecoverable marks in the next two months.

 

 If my expectations are correct, April end will be the lowest the stock markets in India . For the others, who believe in short selling I do see some amount of good trading holding on.

Tuesday, October 21, 2008

karzzzzzzzzzzzzzzzzzzz

It so happened that I was deciding whether to watch this movie or not, but my friends have vowed only to watch the movie that will feature Himesh and Rakhi Sawant in the same movie.

 

 

Kar zzzzzzzzzzzz, that definitely brags about itself

 

Friday, October 17, 2008

Nasdaq today

I was waiting to see something like this for a long time. I know that the world considers United States as its capital . Indians typically don’t want to go to Europe, the sole reason being the fact that if I have got to live like a church rat, I better be saving some money to show off when I come back to India, rather than spending all that I earn out there in Europe.

 

 

Now there are obviously places like Italy , where people have taken shelter as refuges for a long time, but the major intention being , travelling across the continent all the way to England, which is a mother land to many Indians, some left back and some who went there long time back

 

The American dream comes at a price, the first generation that goes there gives his heart and soul to reach a decent or so called standard lower middle class livelihood , though in the recent past, many Chinese and Indian first generation Americanized Desis have made some mark out there , typically joining the middle class out there in starting head on with most of the people out there. Now wonder there are now many second generation Indians who are slowly taking their stances as they got the platform and the educational background to start with,

 

The American dream has the only price that you got to adopt it sooner or later, You got to become an American by way or will of your children , or meontary , and social upliftment that comes with the American life. Slowly you realize that being a hoarder you are actually the best possible American out there. And the time now has come to show world that, there cannot be a society full of people who are not productive , but take away a large share of the world produce, only to live beyond the living standards that other parts of the world dream of.

 

Though , blame it one poverty and the will to earn a decent livelihood, chased by the childhood demons of  a low social status due to monetary conditions and the scene of parents sweating blood money out to educate a child, the Indian and the Chinese rushes and keeps rushing towards , whatever comes his way,

Most middle class Indians, produce a far productive human being than many other countries in the world,

 

The challenges of surviving in a populated country like India itself requires such a lot of commitment that the molding starts right at the tender ages when a child starts to go to a school loaded in a auto, suffocating in a bus only to get seat sometimes.

 

We don’t need a Suana to sweat off, we sweat on the way home, we meditate through out prayers and don’t need high powered yogis and tantriks to teach us Yoga on a evening class.

By the time we are ready to venture in to the world, we have already , been converted into work machines.

 

This is the way the world runs . Nasdaq today showed some interesting features,

 

if you were to follow the last few days in the market,  these are the items that are slowly strengthening in the markets out there,

 

agricultural products; industrial REITs; coal and consumable fuels; steel; consumer finance; construction materials; internet software and services; home entertainment software; forest products; biotech

 

 

Well, to follow are the items that are slowly weakening, sure signs of the countries, increasing  need to reiterate its societal awareness, the country has to wake up to need to the globe as a whole

 

homefurnishings; real estate svcs; oil and gas equip and services; auto parts and equip; multi-sector holdings; homebuilding; publishing; gold; electronic components; household appliances

 

Luxury out to an extent. I would not say that India is strengthening, due to this whole fiasco. India still remains tangled in it age old system and culture and things are still going at a pace which I believe will take its time

 

I am one unfortunate person , who will not be able to witness the change, but definitely feel the winds of change may be,

 

 

Trading strategies

Some trading strategies collected online

 

1.     Scalping

This is mainly termed for trading strategies where you sell off at the point of immediate profitability, that is, if you are satisfied, sell it and bury the hatchet, there is not need to look beyond at what happened during the rest of the day. A quick way to earn money

2.     Fading

Commonly applied to short covering, where you take some shares from the broker or the agent and then at the end of the day when the prices have come down buy those from the market and replace the ones you brought from the broker back to the, this is mainly like futures and options, Though risky as share market on loan or credit is supposed to be philosophically abhorred

3.     Daily Pivots

For maths lovers this could be interesting , as you try to go by the High of the day and the low of the day points of sales and buying , you simply sell off at the point the snake is regressing or buy at the point it is taking a u turn up               

4.     Momentum

Though a one, but if you are one of the early investors in a day , you will be happy to apply this one, mainly relying on market news, big explosive breaking news etc, you wait for things like that, which happens once in a while and then play your game and exit,

never think , what could have happened, that way you will end up thinking as to what could have happened if you were born in New York , or what could have happened if you were the son of the big B, etc

 

Anyway , generalizing the market strategies is not not easy, but this is as far as it gets in characterizing the various traders in the market, hope this helps,

In the process of reading and collecting data online about the share market, I will try to enrich this blog with as much data about the share market as possible. I will try to give it the look of a new comer to  the market to the expert stage metamorphosis program

 

               

Wednesday, October 15, 2008

John Fister resigns

So Cadence is not doing good at all. That just kills one place a regular EDA guy could jump once in a while,

Actually, for many it was like, See I am from a competition and I will come to you , please send me the invitation by mail asap.

 

And then there were attempts to revamp the employees status within the company , if some one sniffed out that you were planning to move to Cadence, you were all of a sudden asked to join the bigger corporate parties , meet the biggies . Actually, not, your salary was increased and a grade upgradation may be.

Well ,

it is all upto speculation , this is a good story for Synopsys management but for regular employees, it just is another loss of opportunity

http://www.deepchip.com/wiretap/081015.html

Lack of clear literature as of now

I am finding it difficult every day to have one single point of data collection for the  stock market. And the market analysis is not yet the best if you were to follow network 18, CNBC awaz, Zee Business and NDTV profit,

That is pretty much the bouquet of channels that I get, here sitting at home I will be wasting time trying to figure out and browse through all the electronic media available for comprehensive reports of major stocks and the way , the major money market moves,

 

May not be case studies every day , but stock analysis of some major stocks could be an added advantage in one media that you maintain. If I am able to float the first Bengali Magazine online, I will definitely take that as my second project to get one online share market magazine asap.

I know that the market for that is open , and there are already some magazines that do that, 4 news channels completely devoted to that single aim is one example of what I am pointing at.

Tuesday, October 14, 2008

Khoon

"খুন"

একটা ছেলে

তার মা বাবা ভাই বোন আর

এক চিলতে ঘড় নিয়েই শুধু বাঁচার স্বপ্ন দেখেছিল

 

সেই ছেলেটা

একদিন

ইতিহাসের আ্‌হ্বানে তার

পুরানো স্বপ্নগুলিকে সার্থক করার প্রয়োজনে

দেশটাকেই প্রথম বাঁচাতে গেল

দূর ছাই

ছেলেটাই মরে গেল

 

 

Monday, October 13, 2008

Ya rabba

pyaar hai yaa sajaa,e mere dil bataa
TuuTataa kyo nahii, dard kaa silasilaa
is pyaar me ho kaise kaise imtihaa
ye pyaar likhe kaisii kaisii daasataa

yaa rabbaa... de de koii jaan bhii agar
dilabar pe ho naa, dilabar pe ho naa koi asar
ho..
yaa rabbaa... de de koii jaan bhii agar
dilabar pe ho naa, dilabar pe ho naa koi asar
ho...
pyaar hai yaa sajaa,e mere dil bataa
TuuTataa kyo nahii dard kaa silasilaa

kaisaa hai safar wafaa kii manziil kaa
naa hai koi hal dilo ki mushkiil kaa
dhaDkan dhaDkan bikharii ranziishe
saase saase Tooti bandishe
kahii to har lamhaa hoTho pe fariyaad hai
kisii kii duniyaa chaahat me barabaad hai

yaa rabbaa... de de koii jaan bhii agar
dilabar pe ho naa, dilabar pe ho naa koi asar
ho..
yaa rabbaa... de de koi jaan bhii agar
dilabar pe ho naa, dilabar pe ho naa koi asar

koii naa sune sisaktii aanho ko
koii na dhare taDapatii baaho ko
aadhii aadhii purii khwaahiishe
Tooti phooTi sab farmaaishe
kahii shak hai kahii nafarat kii deewaar hai
kahii jeet me bhii shaamil palapal haar hai

yaa rabbaa... de de koii jaan bhii agar
dilabar pe ho naa, dilabar pe ho naa koi asar
ho..
yaa rabbaa... de de koi jaan bhii agar
dilabar pe ho naa, dilabar pe ho naa koi asar
ho..
pyaar hai yaa sajaa,e mere dil bataa
TuuTataa kyo nahii, dard kaa silasilaa
ho..

naa poochho dard bando se,hasii kaisii khushii kaisii
musibat sar pe rehatii hai,kabhii kaisii kabhii kaisii

ho o o o... rabbaa, rabbaa ho o o ho
rabbaa ho o o, ho o ho rabbaa

 

Markets did a summersault today

It was a mirror image of what happened on Friday as they say  it, Some of the shares that I was looking up to like Shobha developers and Yes Bank and they both did about 10 % jump . If I were into intra day trading I would have made 10 K in one single day. What I am doing now is slowly analyzing the market. We need to study the American market patterns of the 1940s and 50s , Since India today pretty much resembles the market times in those periods. 

Some softwares I have written will mainly look like enhanced Duckworth Lewis System that they apply for Cricket. What I am looking forward to is a language that can take in semantics at the end of the day , it will be a dynamic program that will run throughout the day  studying Nikkei, HangSeng, Nifty, FTSE, CAC and they Dow , the whole day, try and find out the patterns. I know many softwares have been already written but what I believe is that there should be a language in which you can interpret the market,

Lets say there exists a language that can do a real time analysis of the market and then send you reports at the end of the day that these are potentially those guys who have a better chance in the markets tomorrow.

Sunday, October 12, 2008

Second edition of the news site has went in

So the second page which was completely done without my help is already out, This is a great moment for me. I will be rather happy if it regularly comes out as a the news site where all the news for the day could be consolidated and found. I will be experimenting with some more newspapers online to get hold of more data that now

 

http://southwesteastnorth.blogspot.com/

A crashy time for Nasdaq

Tuesday is supposed to be the worst day for the stock market in the coming times. It will go down in history as the worst ever if America is not cautious in how they handle the Monday that is tomorrow

 

 

Treasury in U K have already started to realize the liquidity crunch and have started to inject money into their major banks and soon it will out of our hands if the Nasdaq were not cope up by same measures , Some predict that Tuesday as a result of the biggest crash in Nasdaq, BSE will see the 9000 days back and it may be a huge downfall, since from here, any 1000 points is straight 10 % fall in the market. These are very good time for contrarians and we may be touching rock bottom in about another week

Saturday, October 11, 2008

Somebody called for NiftybeES

Well,

Some of the money managers are now heavily rushing to the commodities sector, For many others there are advisors galore for GOLD MCX, but I will rather look out for NIFTY BEES, you can get hold of it in the broker agencies near to you.

Another idea for 11 Oct 2008

After I am done with some of the personal projects that I am taking up for VCS,I will be able to devote some time out from the EDA industry to delve into the stock markets , I know it is difficult to find a site that maintains all the data , but I will like to get out as much as data as possible from the other stock sites and get one consolidated website to do all that. Initially it might be very difficult to go ahead given the volume of data , but since managing work like in VCS you learn to manage huge regressions ( number of test cases ) you grow up to the idea of having an environment where huge data is getting monitored.

I will also be trying to get in some AI into the market, I know it is difficult to look into major markets that way since you know that it is mainly a sophisticated platform for gambling as many who stay out of it choose to do so, but I still haven’t thought much about whether it is a game of luck or not,

But definitely sitting at home, waiting for somebody else to do his or her business to grow and put all the hardwork , you cannot earn money that way, You can show me Warren Buffet but for that you will need all your life to earn that much, moreover, there is only one Warren Buffet and you need to be much more than that to be earning in a real platform, producing something and selling that. That is what is called business, You will have to put hard work and reap benefits for it. You cannot sit at home reading about stocks and how they play and then let somebody else make money for you

Finally I can unveil the news site

 I am trying to put up a common site for all the news that is collected all around the net during the day. This site will come up every day after 7 in the evening. This time has been chosen so that almost all the important news for the day can be collected in one single point.

 

http://southwesteastnorth.blogspot.com/

 

I will try to add more and more features to it as the days pass. Today was the inauguration for the same. I will be getting a consolidated mail regarding it everyday in the evening about the blog.

Thursday, October 9, 2008

Just keeping the following list

Websites and names of Indian newspapers and publications online

 

Asian Age
Offers daily India and South Asia news.

Asian News International (ANI)
New Delhi based multimedia news agency providing news coverage from India and South Asia.

Business Standard
Major financial newspaper.

Economic Times
Daily business newspaper from the Times of India group.

Express India
News portal publishing several major Indian newspapers.

Financial Express
Provides financial and industrial news, stock market reports.

Hard News
Political Indian magazine, partner of the eminent French monthly Le Monde Diplomatique.

Hindu
National daily newspaper, based in Madras.

Hindu Group of Publications
Online presentation of many Indian newspapers and magazines.

Hindustan Times
Major daily newspaper from Delhi.

India Daily
News, primarily aimed at foreign and expatriate audience.

India Monitor
Online news service covering Indian subcontinent.

Indian Express
Delhi based daily.

Indian Media & Advertising News

Milli Gazette
Newspaper for Indian Muslims.

NDTV.com
News site of Delhi-based TV offering live video reports.

New Indian Express
Newspaper with focus on the southern states.

News Track India
News portal contains all the latest stories from India and around the world.

Outlook India
Weekly news magazine known for in-depth, investigative reporting.

Radiance Viewsweekly
India's oldest Muslim English weekly.

Rediff
Indian news and entertainment portal.

Samachar.com
Provides aggregates news from all major Indian newspapers.

Statesman
One of India's oldest newspaper, based in Calcutta.

Tehelka
Alternative news magazine.

Telegraph
Calcutta-based national daily.

Times of India
Quality national daily from Delhi.

Week
Weekly magazine with critical reporting of national news.

 

Some interesting thing to ponder on

 

 

 

17 May 2006 index was 12,217, 14 Jun 2006 index was 8,929

 

I found this some where in one of the discussion threads in traderji .com. Thing is that too many people cannot be doing the right thing, that takes the fun of being right at the right time. So discussion forums when filled with tips and advices, it becomes difficult to gleam out any significant content out from any of those.

 

Like the commodities market , which plays seasonal did take a reverse turn this time, which goes on to show what common people entering the market and retail investors becoming experts can do . There is a simple law of physics, that is the pyramidal shape.

Everything follows the pyramid way, whether it is the spiritual path,  or the monetary world or the structure of a company or the foundation of a good building.

The stability comes only from the pyramidal shape , with the low lying bricks to carry the brunt of the pressure always, and the top ones getting the sun .

 

During the exam period the paper stocks are supposed to go up  , but if you were to read this years trends you will find out to be the opposite ( not exactly opposite,  I am not the director of Sansani , churning out terrible stories). All I am saying is that too many people read into these kind of seasonal playing and that creates the kind of effect that makes the market statistics go crazy

 

 

Some data regarding some of the mutual funds in India

Though most of the houses are running low as we speak ( it is Oct 2008 ) one of the worst crises since  the 1930s depression.

 

Well , Karan Thapar was hosting one interview of Montek Singh Ahluwalia ,and he rather brought out the point candidly that the time coincides with Christian killings in Orissa, Tata suffering at the hands of land politics, and liquidity crunch in the ongoing market.

 

Still, I believe that there is a lighter side to it all, and that is that the fundamentals itself will not break and investors who are planning only for a long term plan can be in the win win position.

Though there is no proof of the data below, but I got hold of it from Money control.com

 

 

Fund

SIP returns over 8 years

Normal returns over 8 years

Franklin India Bluechip

27.76%

25.28%

Pru ICICI Growth

23.61%

19.73%

HDFC Equity

31.53%

29.38%

Reliance Growth

40.71%

35.90%

 

 

I believe that what they are trying so sell here is that SIP is the best way to average out the market ups and downs which many experts believe is the best way to play the market.

One thing definitely goes always is the fact that if money making was an easy game there is no need for running any business, starting any company and think about development,

When half the world sits and does research about how the companies are moving and a small bunch tries it out the hard way to make money the good old way, by producing something and by selling something, there is bound to be an economic catastrophe and that is exactly what happened this time

Wednesday, October 8, 2008

Entering Dashami

Surprising though that none of the days it rained, and it last did son on Saptami morning. The day turned out to be pretty hot on Saptami.

 

Today we have already entered Dashami and I am still working. It is 1:34 in the morning. I know, people are exactly afraid of becoming like me. Yes hard work and no holidays seems to be the order of the day.

I am planning to go out for some of the nearby pandals after some more time, but feel very tired. Bye Durga Puja.

Right back in 2006 , I had planned to take my family to Agartala for the Durga Puja 2008. Today I feel lost in those terms. Things never go out as planned,

It was a two year old plan but did not materialize. I think, commonality is induced with time and slowly you realize that there is nothing left in you other than working in this complex place where things are not always what they seem

 

The goals are there. Many do the hard work to reach those places, but  there is only a space for a handful, the rest who are giving their best will end up seeing a rewardless place .

Tuesday, October 7, 2008

The incantations on the Nabami morning

This time, this might have been the first time that I am not out on Ashtami at least. I was working whole day , just took some time out to get some water bottles since there was no drinking water at home.


The morning was complete with sounds from the nearby pandal . The nabami incantations are on and they are using the mike as usual. Not that I am having problems with it, rather I like it. It churns out some of the best memories of my old times.

 

Nabami is a great day for us, since it is almost taken as the last day for the pujas. Though many believe that tomorrow being a Thursday , we cannot immerse the durga tomorrow , we will rather do it on the coming Friday . I believe that in Hyderabad and Bangalore, they would be doing it on the weekend since they have to rely on people coming from their work desks to do the work.

 

No body gets any holidays for the same. The day is a bit on the cloudy side and I am getting the feeling that today we will get the most number of people on the roads. I will try and get a sneak peek into the nearby good ones.

Netaji Sporting Club and Laketown Adhibaashi Brinda are two of the better ones out here. Dum Dum Park is another one that is quite famous. Sreebhumi Puja gathers a lot of attention due the incoming flux of people from Barasat and Madhyamgram and beyond.

 

The Lake town Adhibashi Brinda puja  ,opposite to the Jaya cinema hall is very famous due to the protima shilpi or the idol artist, Sushanta Pal, He also makes 3 other famous idols for the city like 66 palli.

I keep chasing bugs

From 2 o clock in the afternoon , the only thing that I have possibly done is chase about 4 bugs, well, learning some thing or the other. This is now a process that has started to look like unfathomable.

There is just too much to learn. The smarter guy would choose only the things that really matter , but I am finding myself increasingly lost in this process. Since if I clog with the work at hand, I slowly  keep the important matters in hand , or pending decisions in a stack which I am not visiting ever again,

They just get stuck there as loose ends . The strings that never got a chance to get back

 

Still, there are a lot of other things that I keep doing,like blogging, figuring out the stock market. But one small thing for all, time is flying. Never before has it done so at such a quick pace as I have done.

 

Today in India, with a cut throat competition and the western markets helping us, I think we desperately need heroes who can create an India, where we need a TCS or a Wipro  only serve the local markets. Currently foreign companies, set up by individuals or teams with vision that goes in time well into future had at some point of time taken the pains ( not that the rewards were not fulfilling ) , but these individuals set up industries, infrastructures, and companies that succeeded in changing the face of the economic world and they keep doing so even till now.

And India is one example, our IT boom is an example of what we can get from just helping them in their business.

Think if we were to host such business houses within the nation , the value we could have added to the company, the country and the place we live  in.

 

We are losing it !

Happy Durga Puja to all the blog readers

Why to not use C Shell

If ever posed by this question by your seniors, Do put this thing up front, Since most sites with time go missing , or are asked to retire due to the maintenance costs, I thought rather use Google Blogging platform to keep many of the things that keep finding ( rather handy things  )  here .

 

Well, coming back to using and not using C Shell, Choice is not to use,

For the following reasons .

 

======================================================================

               Top Ten Reasons not to use the C shell

======================================================================

 

 

        Written by Bruce Barnett

        With MAJOR help from

             Peter Samuelson

             Chris F.A. Johnson

             Jesse Silverman

             Ed Morton

             and of course Tom Christiansen

 

        Updated: 

                                 September 22, 2001

                                 November 26, 2002

                                 July 12, 2004

                                 February 27, 2006

                                 October 3, 2006

                                 January 17. 2007

                                 November 22, 2007

                                 March 1, 2008

 

 

 

        In the late 80's, the C shell was the most popular interactive

shell.  The Bourne shell was too "bare-bones." The Korn shell had to

be purchased, and the Bourne Again shell wasn't created yet.

 

        I've used the C shell for years, and on the surface it has a

lot of good points. It has arrays (the Bourne shell only has one).  It

has test(1), basename(1) and expr(1) built-in, while the Bourne shell

needed external programs.  UNIX was hard enough to learn, and spending

months to learn two shells seemed silly when the C shell seemed

adequate for the job. So many have decided that since they were using

the C shell for their interactive session, why not use it for writing

scripts.

 

               THIS IS A *BIG* MISTAKE.

 

        Oh - it's okay for a 5-line script. The world isn't going to

end if you use it. However, many of the posters on USENET treat it as

such.  I've used the C shell for very large scripts and it worked fine

in most cases. There are ugly parts, and work-arounds. But as your

script grows in sophistication, you will need more work-arounds and

eventually you will find yourself bashing your head against a wall

trying to work around the problem.

 

        I know of many people who have read Tom Christiansen's essay

about the C shell (http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/

), and they were not really convinced. A lot of Tom's examples were

really obscure, and frankly I've always felt Tom's argument wasn't as

convincing as it could be.  So I decided to write my own version of

this essay - as a gentle argument to a current C shell programmer from

a former C shell fan.

 

[Note - since I compare shells, it can be confusing. If the line starts

with a "%" then I'm using the C shell. If in starts with a "$" then it

is the Bourne shell.

 

              -------------------------------------

              Top Ten reasons not to use the C shell

              -------------------------------------

 

        1. The Ad Hoc Parser

        2. Multiple-line quoting difficult

        3. Quoting can be confusing and inconsistent

        4. If/while/foreach/read cannot use redirection

        5. Getting input a line at a time

        6. Aliases are line oriented

        7. Limited file I/O redirection

        8. Poor management of signals and sub-processes

        9. Fewer ways to test for missing variables

        10. Inconsistent use of variables and commands.

 

 

 

 

1. The Ad Hoc Parser

 

        The biggest problem of the C shell it its ad hoc parser.

Now this information won't make you immediately switch shells.

But it's the biggest reason to do so. Many of the other items listed

are based on this problem. Perhaps I should elaborate.

 

        The parser is the code that converts the shell commands into

variables, expressions, strings, etc. High-quality programs have a

full-fledged parser that converts the input into tokens, verifies the

tokens are in the right order, and then executes the tokens.

 

        The C shell does not do this. It parses as it executes. You

can have expressions in many types of instructions:

 

%       if ( expression )

%       set variable = ( expression )

%       while ( expression )

 

        They should be treated the same. They are not. You may find out that

 

%       if ( 1 )

 

is fine, but

 

%       if(1)

 

generates a syntax error. Or that the above works, the "while" command:

 

%    while(1)

 

fails.

 

        You never know when you will find a new bug.  As I write this

(September 2001) I ported a C shell script to another UNIX system. (It

was my .login script, okay? Sheesh!) Anyhow I got an error "Variable

name must begin with a letter" somewhere in the dozen files used when

I log in. I finally traced the problem down to the following "syntax"

error:

 

%       if (! $?variable ) ...

 

               Which variable must begin with a letter? Give up?  The solution -

you must add a space before the "!" character to fix the "error." The

examples in the manual page don't mention that spaces are required.

Sigh...

 

               Here's another one. I wanted to search for a string at the end

of a line, using grep. That is

 

%              set var = "string"

%              grep "$var$" < file

 

               Most shells treat this as

%                      grep "string$" <file

               Great. Does the C shell do this? As John Belushi would say, "Noooooo!"

               Instead, we get

 

                                Variable name must contain alphanumeric characters.

               Ah. So we back quote (backslash) it.

 

%                      grep "$var\$" <file

               This doesn't work. The same thing happens. One work-around is

 

%                      grep "$var"'$' <file

 

               Sigh...

 

        Most of the flaws are due to the ad hoc parser. For instance,

 

%              if ( $?A ) set  B = $A

 

        If variable A is defined, then set B to $A.  Sounds good. The

problem? If A is not defined, you get "A: Undefined variable."

 

        If you want to check a Bourne shell script for syntax errors,

use "sh -n." This doesn't execute the script. but it does check all

errors. What a wonderful idea. Does the C shell have this feature? Of

course not.  Errors aren't found until they are EXECUTED.  For

instance, the code

 

%       if ( $zero ) then

%              while

%              end

%       endif

 

will execute with no complaints. However, if $zero becomes one, then

you get the syntax error:

 

        while: Too few arguments.

 

Here's another:

 

if ( $zero ) then

    if the C shell has a real parser - complain

endif

 

In other words, you can have a script that works fine for months, and

THEN reports a syntax error. Your customers will love this

"professionalism."

 

And here's another I just found today (October 2006).

Create a script that has

 

#/bin/csh -f

if (0)

endif

 

 

And make sure there is no "newline" character after the endif.

Execute this and you get the error

               then: then/endif not found.

 

Now add one line in the middle

 

#/bin/csh -f

if (0)

else

endif

 

 

and again - make sure there is no newline character at the end of the

last line.  Run it again and it works fine.

 

And we are just getting warmed up. The C shell a time bomb, gang...

 

        Tick... Tick... Tick...

 

 

2. Multiple-line quoting difficult

 

 

        The C shell complaints if strings are longer than a line.

If you are typing at a terminal, and only type one quote, it's nice to

have an error instead of a strange prompt. However, for shell

programming - it stinks like a bloated skunk.

 

 

        Here is a simple 'awk' script that adds one to the first value

of each line. I broke this simple script into three lines, because

many awk scripts are several lines long. I could put it on one line,

but that's not the point. Cut me some slack, okay?

 

        #!/bin/awk -f

        {print $1 + \

               2;

        }

 

        Calling this from a Bourne shell is simple:

 

        #!/bin/sh

        awk '

        {print $1 + \

               2;

        }

        '

 

        They look the SAME! What a novel concept. Now look at the C

shell version.

 

        #!/bin/csh -f

         awk '{print $1 + \\

                2 ;\

         }'

 

 

        An extra backslash is needed. One line has two backslashes, and the

second has one. Suppose you want to set the output to a variable.

Sounds simple? Perhaps. Look how it changes:

 

        #!/bin/csh -f

        set a = `echo 7 |  awk '{print $1 + \\\

                2 ;\\

         }'`

 

        Now you need three backslashes!  And the second line only has two.

Keeping track of those backslashes can drive you crazy when you have

large awk and sed scripts. And you can't simply cut and paste scripts

from different shells - if you use the C shell. Sometimes I start

writing an AWK script, like

 

#!/bin/awk -f

BEGIN {A=123;}

etc...

 

And if I want to convert this to a shell script (because I want to

specify the value of 123 as an argument), I simply replace the first line with:

 

#!/bin/sh

awk '

BEGIN {A=123'}

etc.

 

If I used the C shell, I'd have to add a \ before the end of each line.

 

 

        Also note that if you WANT to include a newline in a string,

strange things happen:

%       set a = 'a \

        b'

%       echo $a

        a  b

 

        The newline goes away. Suppose you really want a newline in

the string. Will another backslash work?

 

%       set a = 'a \\

        b'

%       echo $a

        a \  b

 

        That didn't work. Suppose you decide to quote the variable:

 

%       set a = 'a \

        b'

%       echo "$a"

        Unmatched ".

 

        Syntax error!? How bizarre.  There is a solution - use the :q

quote modifier.

 

%       set a = 'a \

        b'

%       echo $a:q

        a

        b

 

        This can get VERY complicated when you want to make aliases

include backslash characters. More on this later. Heh. Heh.

 

 

        One more thing - normally a shell allows you to put the quotes anywhere on a line:

        echo abc"de"fg

is the same as

        echo "abcdefg"

 

That's because the quote toggles the INTERPRET/DON'T INTERPRET parser.

However, you cannot put a quote right before the backslash if it follows a

variable name whose value has a space. These next two lines generates

a syntax error:

 

%       set a = "a b"

%       set a = $a"\

        c"

 

All I wanted to do was to append a "<new line>c" to the $a variable.

It only works if the current value does NOT have a space. 

In other words

 

%       set a = "a_b"

%       set a = $a"\

        c"

 

is fine. Changing "_" to a space causes a syntax error. Another

surprise. That's the C shell - one never knows where the next surprise

will be.

 

 

3. Quoting can be confusing and inconsistent

 

        The Bourne shell has three types of quotes:

 

        "........" - only $, `, and \ are special.

        '.......' - Nothing is special (this includes the backslash)

        \.       - The next character is not special

                        (Exception: a newline)

 

        That's it. Very few exceptions. The C shell is another matter.

    What works and what doesn't  is no longer simple and easy to understand.

 

 

              

 

 

As an example, look at the backslash quote. The Bourne shell uses the

backslash to escape everything except the newline. In the C shell, it

also escapes the backslash and the dollar sign. Suppose you want to enclose

$HOME in double quotes. Try typing:

 

%       echo "$HOME"

        /home/barnett

 

 

Logic tells us to put a backslash in front. So we try

 

%       echo "\$HOME"

        \/home/barnett

 

Sigh.

So there is no way to escape a variable in a double quote. What about

single quotes?

 

%              echo '$HOME'

        $HOME

 

works fine. But here's another exception.

 

%              echo MONEY$

               MONEY$

%              echo 'MONEY$'

               MONEY$

%              echo "MONEY$"

               Illegal variable name.

 

 

The last one is illegal. So adding double quotes CAUSES a syntax error.

 

With single quotes, "!" character is special, as is

the "~" character.  Using single quotes (the strong quotes) the

command

 

%       echo '!1'

        1: Event not found.

 

will give you the error

 

 

 

A backslash is needed because the single quotes won't quote the

exclamation mark.  On some versions of the C shell,

 

               echo hi!

 

works, but

 

               echo 'hi!'

 

doesn't. A backslash is required in front:

 

               echo 'hi\!'

 

or if you wanted to put a ! before the word:

 

               echo '\!hi'

 

Now suppose you type

 

%       set a = "~"

%       echo $a

        /home/barnett

%       echo '$a'

        $a

%       echo "$a"

    ~

 

The echo commands output THREE different values depending on the quotes.

So no matter what type of quotes you use, there are exceptions.

Those exceptions can drive you mad.

 

And then there's dealing with spaces.

 

If you call a C shell script, and pass it an argument with a space:

 

%       myscript "a b" c

 

Now guess what the following script will print.

 

        #!/bin/csh -f

        echo $#

        set b = ( $* )

        echo $#b

 

        It prints "2" and then "3". A simple = does not copy a variable

correctly if there are spaces involved. Double quotes don't help.

It's time to use the fourth form of quoting - which is only useful

when displaying (not set) the value:

 

%       set b = ( $*:q )

 

 

Here's another. Let's saw you had nested backticks.

Some shells use $(program1 $(program2)) to allow this.

The C shell does not, so you have to use nested backticks.

I would expect this to be

               `program1 \`program2\` `

but  what works is the illogical

               `program1 ``program2``

 

 

 

        Got it? It gets worse. Try to pass back-slashes to an alias

You need billions and billions of them. Okay. I exaggerate.

A little. But look at Dan Bernstein's two aliases used to get quoting

correct in aliases:

 

%       alias quote "/bin/sed -e 's/\\!/\\\\\!/g' \\

        -e  's/'\\\''/'\\\'\\\\\\\'\\\''/g' \\

        -e 's/^/'\''/' \\

        -e 's/"\$"/'\''/'"

%       alias makealias "quote | /bin/sed 's/^/alias \!:1 /' \!:2*"

 

You use this to make sure you get quotes correctly specified in aliases.

 

        Larry Wall calls this backslashitis. What a royal pain.

        Tick.. Tick.. Tick..

 

4. If/while/foreach/read cannot use redirection

 

   The Bourne shell allows complex commands to be combined with pipes.

   The C shell doesn't. Suppose you want to choose an argument to grep.

   Example:

 

%       if ( $a ) then

%          grep xxx

%       else

%          grep yyy

%       endif

 

        No problem as long as the text you are grepping is piped into the

script. But what if you want to create a stream of data in the script?

(i.e. using a pipe).  Suppose you change the first line to be

 

%       cat $file | if ($a ) then

 

        Guess what? The file $file is COMPLETELY ignored. Instead, the

script use standard input of the script, even though you used a pipe on that line.

The only standard input the "if" command

can use MUST be specified outside of the script. Therefore what can be

done in one Bourne shell file has to be done in several C shell

scripts - because a single script can't be used. The 'while' command

is the same way. For instance the following command outputs the time

with hyphens between the numbers instead of colons:

 

$       date | tr ':' ' ' | while read a b c d e f g

$       do

$       echo The time is  $d-$e-$f

$       done

 

        You can use < as well as pipes. In other words, *ANY* command in

the Bourne shell can have the data-stream redirected. That's because it

has a REAL parser [rimshot].

 

        Speaking of which... The Bourne shell allows you to combine

several lines onto a single line as long as semicolons are placed

between. This includes complex commands. For example - the following

is perfectly fine with the Bourne shell:

 

$       if  true;then grep a;else grep b; fi

 

        This has several advantages. Commands in a makefile - see

make(1) - have to be on one line. Trying to put a C shell "if" command

in a makefile is painful.  Also - if your shell allows you to recall

and edit previous commands, then you can use complex commands and edit

them. The C shell allows you to repeat only the first part of a

complex command, like the single line with the "if" statement. It's

much nicer recalling and editing the entire complex command. But

that's for interactive shells, and outside the scope of this essay.

 

5. Getting input a line at a time

 

        Suppose you want to read one line from a file. This simple

task is very difficult for the C shell. The C shell provides one way

to read a line:

 

%       set ans = $<

 

        The trouble is - this ALWAYS reads from standard input.  If a

terminal is attached to standard input, then it reads from the

terminal.  If a file is attached to the script, then it reads the

file.

 

        But what do you do if you want to specify the filename in the

middle of the script?  You can use "head -1" to get a line. but how do

you read the next line? You can create a temporary file, and read and

delete the first line. How ugly and extremely inefficient. On a scale

of 1 to 10, it scores -1000.

 

        Now what if you want to read a file, and ask the user

something during this?  As an example - suppose you want to read a

list of filenames from a pipe, and ask the user what to do with some of

them? Can't do this with the C shell - $< reads from standard input. Always.

The Bourne shell does allow this. Simply use

 

$       read ans </dev/tty

 

to read from a terminal, and

 

$       read ans

 

to read from a pipe (which can be created in the script). Also - what

if you want to have a script read from STDIN, create some data in the

middle of the script, and use $< to read from the new file. Can't do

it.  There is no way to do

 

               set ans = $< <newfile

or

               set ans = $< </dev/tty

or

               echo ans | set ans = $<

 

  $< is only STDIN, and cannot change for the duration of the script.

The workaround usually means creating several smaller scripts instead

of one script.

 

 

6. Aliases are line oriented

 

        Aliases MUST be one line. However, the "if" WANTS to be on

multiple lines, and quoting multiple lines is a pain. Clearly the work

of a masochist. You can get around this if you bash your head enough,

or else ask someone else with a soft spot for the C shell:

 

%       alias X 'eval "if (\!* =~ 'Y') then \\

              echo yes \\

              else \\

              echo no \\

              endif"'

 

        Notice that the "eval" command was needed. The Bourne shell

function is more flexible than aliases, simpler and can easily fit on

one line if you wish.

 

$       X() { if [ "$1" = "Y" ]; then  echo yes; else echo no; fi;}

 

 

If you can write a Bourne shell script, you can write a function.

Same syntax.  There is no need to use special "\!:1" arguments, extra

shell processes, special quoting, multiple backslashes, etc.  I'm

SOOOO tired of hitting my head against a wall.

 

Functions allow you to simplify scripts. Anything more sophisticated

than an alias that would require function requires a separate csh

script/file.

 

Tick..Tick..Tick..

 

7. Limited file I/O redirection

 

        The C shell has one mechanism to specify standard output and

standard error, and a second to combine them into one stream. It can

be directed to a file or to a pipe.

 

        That's all you can do. Period. That's it. End of story.

 

        It's true that for 90% to 99% of the scripts this is all you need to

do. However, the Bourne shell can do much much more:

 

        You can close standard output, or standard error.

        You can redirect either or both to any file.

        You can merge output streams

        You can create new streams

 

        As an example, it's easy to send standard error to a file, and

leave standard output alone. But the C shell can't do this very well.

 

        Tom Christiansen gives several examples in his essay.

I suggest you read his examples. See

http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/

 

 

8. Poor management of signals and subprocesses

 

        The C shell has very limited signal and process management.

 

        Good software can be stopped gracefully. If an error occurs,

or a signal is sent to it, the script should clean up all temporary

files. The C shell has one signal trap:

 

%       onintr label

 

        To ignore all signals, use

 

%       onintr -

 

        The C shell can be used to catch all signals, or ignore all signals.

All or none. That's the choice. That's not good enough.

 

        Many programs have (or need) sophisticated signal handling. Sending a

-HUP signal might cause the program to re-read configuration

files. Sending a -USR1 signal may cause the program to turn debug mode

on and off. And sending -TERM should cause the program to

terminate. The Bourne shell can have this control. The C shell cannot.

 

        Have you ever had a script launch several sub-processes and then

try to stop them when you realized you make a mistake?  You can kill

the main script with a Control-C, but the background processes are

still running. You have to use "ps" to find the other processes and

kill them one at a time. That's the best the C shell can do. The

Bourne shell can do better. Much better.

 

        A good programmer makes sure all of the child processes are

killed when the parent is killed.  Here is a fragment of a Bourne

shell program that launches three child processes, and passes a -HUP

signal to all of them so they can restart.

 

$       PIDS=

$       program1 & PIDS="$PIDS $!"

$       program2 & PIDS="$PIDS $!"

$       program3 & PIDS="$PIDS $!"

$       trap "kill -1 $PIDS" 1

 

If the program wanted to exit on signal 15, and echo its process ID, a

second signal handler can be added by adding:

 

$       trap "echo PID $$ terminated;kill -TERM $PIDS;exit" 15

 

You can also wait for those processes to terminate using the wait

command:

 

$       wait "$PIDS"

 

        Notice you have precise control over which children you are

waiting for. The C shell waits for all child processes. Again - all or

none - those are your choices. But that's not good enough.  Here is an

example that executes three processes. If they don't finish in 30

seconds, they are terminated - an easy job for the Bourne shell:

 

$       MYID=$$

$       PIDS=

$       (sleep 30; kill -1 $MYID) &

$       (sleep 5;echo A) & PIDS="$PIDS $!"

$       (sleep 10;echo B) & PIDS="$PIDS $!"

$       (sleep 50;echo C) & PIDS="$PIDS $!"

$       trap "echo TIMEOUT;kill $PIDS" 1

$       echo waiting for $PIDS

$       wait $PIDS

$       echo everything OK

 

 

        There are several variations of this. You can have child

processes start up in parallel, and wait for a signal for synchronization.

 

        There is also a special "0" signal. This is the end-of-file

condition. So the Bourne shell can easily delete temporary

files when done:

 

        trap "/bin/rm $tempfiles" 0

 

        The C shell lacks this. There is no way to get the process ID

of a child process and use it in a script. The wait command

waits for ALL processes, not the ones your specify. It just can't

handle the job.

 

9. Fewer ways to test for missing variables

 

        The C shell provides a way to test if a variable exists -

   using the $?var name:

 

%       if ( $?A ) then

%          echo variable A exists

%       endif

 

However, there is no simple way to determine if the variable has a

value.  The C shell test

 

%     if ($?A && ("$A" =~ ?*)) then

 

Returns the error:

 

    A: undefined variable.

 

You can use nested "if" statements  using:

 

%       if ( $?A ) then

%              if ( "$A" =~ ?* ) then

%                 # okay

%              else

%                      echo "A exists but does not have a value"

%              endif

%       else

%                      echo "A does not exist"

%       endif

 

The Bourne shell is much easier to use. You don't need complex "if"

commands. Test the variable while you use it:

 

$       echo ${A?'A does not have a value'}

 

If the variable exists with no value, no error occurs. If you want to

add a test for the "no-value" condition, add the colon:

 

$       echo ${A:?'A is not set or does not have a value'}

 

Besides reporting errors, you can have default values:

 

$       B=${A-default}

 

You can also assign values if they are not defined:

 

$       echo ${A=default}

 

        These also support the ":" to test for null values.

 

10. Inconsistent use of variables and commands.

 

        The Bourne shell has one type of variable. The C shell has seven:

 

        * Regular variables     - $a

        * Wordlist variables    - $a[1]

        * Environment variables - $A

        * Alias arguments       - !1

        * History arguments     - !1

        * Sub-process variables - %1

        * Directory variables   - ~user

 

        These are not treated the same. For instance, you can use the

:r modifier on regular variables, but on some systems you cannot use

it on environment variables without getting an error. Try to get the

process ID of a child process using the C shell:

 

        program &

        echo "I just created process %%"

 

        It doesn't work. And forget using ~user variables for anything

complicated. Can you combine the :r with history variables? No. I've

already mentioned that quoting alias arguments is special. These

variables and what you can do with them is not consistent.  Some have

very specific functions. The alias and history variables use the same

character, but have different uses.

 

        This is also seen when you combine built-ins. If you have an

alias "myalias" then the following lines may generate strange

errors (as Tom has mentioned before):

 

 

        repeat 3 myalias

        kill -1 `cat file`

        time | echo

       

        In general, using pipes, backquotes and redirection with

built-in commands  is asking for trouble., i.e.

 

        echo "!1"

        set j = ( `jobs` )

        kill -1 $PID || echo process $PID not running

 

There are many more cases. It's hard to predict how these commands

will interact. You THINK it should work, but when you try it, it fails.

 

 

Here are some more examples. You can have an array in the C shell, but

if you try add a new element, you get strange errors.

 

% set a = ()

% @ a[1] = 2

@: Subscript out of range.

 

 

 

So if you wants to add to an existing array, you have to use something like

        set a = ( $a 2 )

 

Now this works

 

        @ arrayname[1] = 4

 

but try to store a string in the array.

 

        @ arrayname[1] = "a"

and you get

 

        @: Badly formed number.

 

 

Another bug - from Aleksandar Radulovic - If the last line of the C

shell script does not have a new line character, it never gets

exeucted.

 

I just discoveed another odd bug with the C shell - thank's to a

posting from "yusufm":

 

Guess what the following script will generate

 

        setenv A 1

        echo $A

        setenv A=2

        echo $A

        setenv B=3

        echo $B

        setenv B=4

        echo $B

 

I'm not going to tell you what the bug is, or how many there are. I

think it's more fun to let you discover it yourself.

 

 

I can add some more reasons. Jesse Silverman says reason #0 is that

it's not POSIX compliant.  True. But the C shell was written before

the standard existed. This is a historical flaw, and not a braindead

stupid lazy dumb-ass flaw.

 

 

                  -------------

                  In conclusion

                  -------------

 

I've listed the reasons above in what I feel to be order of

importance. You can work around many of the issues, but you have to

consider how many hours you have to spend fighting the C shell,

finding ways to work around the problems. It's frustrating, and

frankly - spending some time to learn the basics of the Bourne shell

are worth every minute. Every UNIX system has the Bourne shell or a

super-set of it.  It's predictable, and much more flexible than the C

shell. If you want a script that has no hidden syntax errors, properly

cleans up after itself, and gives you precise control over the

elements of the script, and allows you to combine several parts into a

large script, use the Bourne shell.

 

I found myself developing more and more bad habits over time because I

was using the C shell. I would use

 

               foreach a ( `cat file` )

 

instead of redirection. I would use several smaller scripts to work

around problems in one script. And most importantly, I put off

learning the Bourne shell for years as I struggled with the C

shell. Don't make the same mistake I made.