Shell programming in Linux


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell programming in Linux
# 1  
Old 08-19-2010
Network Shell programming in Linux

Hi,

I have been working on Sun Solaris since a long time. Recently I got to work on RH Linux. My Linux version details are:

Linux 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

I have a simple command in my shell script:

export BKPTAG=`date +"%Y%m%d_%H%M"`

This command does not get executed at all, and the error message is :

line 44: date: command not found

I tried executing the same command at Linux prompt and it gets executed very well.

my shell is /bin/bash and I have mentioned it as the first line in the shell script:

#!/bin/bash

This is very strange to me, can anyone throw light on this? Thanks in advance.
# 2  
Old 08-19-2010
Did you do anything with $PATH variable in this script?
# 3  
Old 08-19-2010
am not sure about what is the error.

But try giving the absolute path of date command.
# 4  
Old 08-19-2010
Yes,

I had modified PATH variable, and had forgot to prefix the assignment with $PATH:

It resolved my issue, Thanks a lot.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Linux programming

Develop a program to display file given on the command line to STDOUT, please give sample program (2 Replies)
Discussion started by: ainstin
2 Replies

2. Shell Programming and Scripting

Linux shell programming performance issue

Hi All, can any one help me on this please. Replace sting in FILE1.txt with FILE2.txt. FILE1.txt record must have at least one state is repeated once.But need to replace only from second occurrence in record in FILE1.txt Condition: order of searching the records in FILE2.txt is impartent.... (8 Replies)
Discussion started by: ureddy
8 Replies

3. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies

4. UNIX for Dummies Questions & Answers

From iOS programming to Linux system programming

Hello. I like Linux and C programming language. Allways wanted to understand kernel and become a Linux system programmer. And I also like Objective-C and iOS. These two programming areas have relations: 1. Linux and iOS are UNIX-like systems, POSIX compliant. 2. It is useful to know C language... (2 Replies)
Discussion started by: Rockatansky
2 Replies

5. Linux

C programming in linux

Hi friends In my linux application, i want to update output in same place i.e.. I want to display my output in specific location in screen(console output) ITERATION 1: (e.g. start diplay from 5th ROW 5th COLOUMN) if my message is "hi" then first time 'h' should print in 5th ROW... (2 Replies)
Discussion started by: venkatgopu
2 Replies

6. Linux

Linux programming

Hi friends! I am new be in Linux system programing. Can you help me to get running processes statistics (pid, uid, %cpu, %mem, pri, ni) without using any commands like TOP, PS. Can you tell me any system call available to get %cpu only or %mem only? Even i include... (2 Replies)
Discussion started by: venkatgopu
2 Replies

7. Programming

c programming in linux

can you guys please let me know what are some of the c programming environment program? you know the ones with checking syntax and auto indentation and such.. dont want to just use vi (although someone did mention to me that in vim, there are capabilities.. but not sure how) thanks in advance. (6 Replies)
Discussion started by: convenientstore
6 Replies

8. Shell Programming and Scripting

Can somebody advise any free Linux sever for shell programming?

Hi, everybody. I just wonder whether there are a couple of free Linux servers running as terminals where people can practice Unix Shell Programming? I'd like to set up one myself but unfortunatly can't do it. I can't switch to Linux now coz I run a couple of servers on my machine. Cygwin is... (3 Replies)
Discussion started by: belgampaul
3 Replies

9. Programming

Programming C in Linux

Hello, I am a basic programer from back in the 80's/90's. I moved on to visual basic and now I want to learn C. I want to eventually program in Linux. Now, before I get on this band wagon I want to ask a few questions to make sure I am getting started out right. 1. Is C a good language to... (2 Replies)
Discussion started by: wizkid
2 Replies
Login or Register to Ask a Question