Sponsored Content
Full Discussion: Need help ( sh: not found )
Top Forums Shell Programming and Scripting Need help ( sh: not found ) Post 302338398 by vidyadhar85 on Monday 27th of July 2009 09:44:04 PM
Old 07-27-2009
try adding these two lines in the begining of the script
Code:
#!/usr/bin/sh
. $HOME/.profile

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

HELP ld.so.1 NOT FOUND

I made the fatal mistake of rename the usr directory. I cannot run any commands due to the fact that ld.so.1 is in usr/lib/--and it doesn't exist How can I recover my system? (1 Reply)
Discussion started by: SmartJuniorUnix
1 Replies

2. Shell Programming and Scripting

how can i check in csh if command found or not found ?

hello all im trying to use in sun Solaris the information received from the top command now i several machines that dont have install the top program so when im running the script im geting error saying after im running this code : set MemoryInfo = `top | grep Memory` if (... (2 Replies)
Discussion started by: umen
2 Replies

3. UNIX for Dummies Questions & Answers

OM not found

Hello everybody: Im facing this weird problem on my SUN V890 running SOL9, from time to time I keep getting this error from the prompt when i press enter for blank: OM: not found sometimes if I entered a coomand it will give me: OM(command name):not found, but repeating the same command it... (4 Replies)
Discussion started by: aladdin
4 Replies

4. Solaris

-sh: H: not found

I have found this error when i logged in as root: su - Any body have any idea where this error coming from or what is not working? -Adeel (1 Reply)
Discussion started by: deal732
1 Replies

5. UNIX for Dummies Questions & Answers

^M: not found

Hi All, when i ran a shell script ,its showing "^M: not found" errore i used the the code dos2unix sunshine.sh sunshine1.sh and then again i ran the scriptand then its still showing the errore please help me in the matter. thanks... (3 Replies)
Discussion started by: manit
3 Replies

6. Shell Programming and Scripting

sh: +: not found

hello all, In a perl script I am writing, $dd =`expr $dd + 1`; for adding $dd, but getting following error: sh: +: not found Please help!! (2 Replies)
Discussion started by: gentleDean
2 Replies

7. UNIX and Linux Applications

^M not found

hi: I had an existing script in production and I commented some lines and implemented the same. The scripts fails with a cc of 127 and I get the msg: ^M: not found I checked the file format and it is a PC file format. Does this cause the script to fail with cc= 127. Can somebody... (4 Replies)
Discussion started by: Meghna
4 Replies

8. Shell Programming and Scripting

Rather: not found

Hey I have a weird "problem" here It's more out of curiosity, my script is working fine, but giving me a "pidt.sh: 7: Rather: not found" error... #!/bin/sh log="log/`date +%F_pidt.log`" echo "---n`date`n---n" >> $log for i in `cat pidt.conf` do || $( /etc/init.d/$i start &&... (3 Replies)
Discussion started by: al0x
3 Replies

9. Programming

curses.h not found , gtk/gtk.h not found

i have downloaded <libncurses5-dev_5.7+20101128-1_i386.deb> and <ndk++-0.0.1alpha4.tar.bz2> which contains the header files curses.h and gtk/gtk.h .. i have also included them using .. #include "/home/ball/Desktop/Sudoku/project/libncurses5-dev_5.7+20101128-1_i386/usr/include/curses.h" ... (2 Replies)
Discussion started by: upvan111
2 Replies

10. Shell Programming and Scripting

If first pattern is found, look for second pattern. If second pattern not found, delete line

I had a spot of trouble coming up with a title, hopefully you'll understand once you read my problem... :) I have the output of an ldapsearch that looks like this: dn: cn=sam,ou=company,o=com uidNumber: 7174 gidNumber: 49563 homeDirectory: /home/sam loginshell: /bin/bash uid: sam... (2 Replies)
Discussion started by: samgoober
2 Replies
Template::Plugin::Date(3pm)				User Contributed Perl Documentation			       Template::Plugin::Date(3pm)

NAME
Template::Plugin::Date - Plugin to generate formatted date strings SYNOPSIS
[% USE date %] # use current time and default format [% date.format %] # specify time as seconds since epoch # or as a 'h:m:s d-m-y' or 'y-m-d h:m:s' string [% date.format(960973980) %] [% date.format('4:20:36 21/12/2000') %] [% date.format('2000/12/21 4:20:36') %] # specify format [% date.format(mytime, '%H:%M:%S') %] # specify locale [% date.format(date.now, '%a %d %b %y', 'en_GB') %] # named parameters [% date.format(mytime, format = '%H:%M:%S') %] [% date.format(locale = 'en_GB') %] [% date.format(time = date.now, format = '%H:%M:%S', locale = 'en_GB) %] # specify default format to plugin [% USE date(format = '%H:%M:%S', locale = 'de_DE') %] [% date.format %] ... DESCRIPTION
The "Date" plugin provides an easy way to generate formatted time and date strings by delegating to the "POSIX" "strftime()" routine. The plugin can be loaded via the familiar USE directive. [% USE date %] This creates a plugin object with the default name of '"date"'. An alternate name can be specified as such: [% USE myname = date %] The plugin provides the "format()" method which accepts a time value, a format string and a locale name. All of these parameters are optional with the current system time, default format ('"%H:%M:%S %d-%b-%Y"') and current locale being used respectively, if undefined. Default values for the time, format and/or locale may be specified as named parameters in the "USE" directive. [% USE date(format = '%a %d-%b-%Y', locale = 'fr_FR') %] When called without any parameters, the "format()" method returns a string representing the current system time, formatted by "strftime()" according to the default format and for the default locale (which may not be the current one, if locale is set in the "USE" directive). [% date.format %] The plugin allows a time/date to be specified as seconds since the epoch, as is returned by "time()". File last modified: [% date.format(filemod_time) %] The time/date can also be specified as a string of the form "h:m:s d/m/y" or "y/m/d h:m:s". Any of the characters : / - or space may be used to delimit fields. [% USE day = date(format => '%A', locale => 'en_GB') %] [% day.format('4:20:00 9-13-2000') %] Output: Tuesday A format string can also be passed to the "format()" method, and a locale specification may follow that. [% date.format(filemod, '%d-%b-%Y') %] [% date.format(filemod, '%d-%b-%Y', 'en_GB') %] A fourth parameter allows you to force output in GMT, in the case of seconds-since-the-epoch input: [% date.format(filemod, '%d-%b-%Y', 'en_GB', 1) %] Note that in this case, if the local time is not GMT, then also specifying '%Z' (time zone) in the format parameter will lead to an extremely misleading result. Any or all of these parameters may be named. Positional parameters should always be in the order "($time, $format, $locale)". [% date.format(format => '%H:%M:%S') %] [% date.format(time => filemod, format => '%H:%M:%S') %] [% date.format(mytime, format => '%H:%M:%S') %] [% date.format(mytime, format => '%H:%M:%S', locale => 'fr_FR') %] [% date.format(mytime, format => '%H:%M:%S', gmt => 1) %] ...etc... The "now()" method returns the current system time in seconds since the epoch. [% date.format(date.now, '%A') %] The "calc()" method can be used to create an interface to the "Date::Calc" module (if installed on your system). [% calc = date.calc %] [% calc.Monday_of_Week(22, 2001).join('/') %] The "manip()" method can be used to create an interface to the "Date::Manip" module (if installed on your system). [% manip = date.manip %] [% manip.UnixDate("Noon Yesterday","%Y %b %d %H:%M") %] AUTHORS
Thierry-Michel Barral wrote the original plugin. Andy Wardley provided some minor fixups/enhancements, a test script and documentation. Mark D. Mills cloned "Date::Manip" from the "Date::Calc" sub-plugin. COPYRIGHT
Copyright (C) 2000-2007 Thierry-Michel Barral, Andy Wardley. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Template::Plugin, POSIX perl v5.14.2 2012-01-13 Template::Plugin::Date(3pm)
All times are GMT -4. The time now is 07:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy