Sponsored Content
Full Discussion: Working with let command
Top Forums Shell Programming and Scripting Working with let command Post 302991024 by Prasannag87 on Monday 6th of February 2017 12:32:48 AM
Old 02-06-2017
Working with let command

Hi,

I need to find out the day of the year and it always needs to be 3 digits:

Code:
#!/bin/ksh
doy=`date '+%j'`
let doy=$doy-1
echo doy

Output is 36, but I need it to print as 036

Appreciate any help on this.
 

10 More Discussions You Might Find Interesting

1. Solaris

last command not working

I have a Solaris 8 Ultra 1 on my network that we use as a utility server. The last command, which looks in the /var/adm/wtmpx file, is not working. When I do a last, the latest entry is dated June 3, but the /var/adm/wtmpx file is dated whenever a login is successful (verified by typing a... (3 Replies)
Discussion started by: antalexi
3 Replies

2. Solaris

ls command not working

Hi, I have installed opensolaris 10 in VMware. Everything is fine except ls command is not working. It is not displaying any files and directories. Sorry if the question is soo trivial. (8 Replies)
Discussion started by: mayahari
8 Replies

3. Shell Programming and Scripting

cp command not working

Hi Guys, I have about 12000 files in a folder and I want to copy these to another folder. I am using the cp command to do this but it errors out saying cp -- argument list too long. Is there any way to get around this? I don't want to do a mv but use only cp. Thanks (9 Replies)
Discussion started by: npatwardhan
9 Replies

4. UNIX for Advanced & Expert Users

command for recently modified files - "find" command not working

I have three files a.txt , b.txt , c.txt in a directory called my_dir1 .These files were created before two or three months . I have a tar file called my_tar1.tar which contains three files a.txt , b.txt , d.txt . Somebody untarred the my_tar1.tar into my_dir1 directory. So existing two files were... (1 Reply)
Discussion started by: joe.mani
1 Replies

5. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi hc.sh "hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

6. Shell Programming and Scripting

help with shell script: cp command not working, but mv command works...

Hello. I would like to ask your help regarding the cp command. We are using a cp command to create a back-up copy of our file but to no avail. It's just not working. We already checked the file and directory permissions and all seems correct. We have a script (ftp.script) which calls on... (1 Reply)
Discussion started by: udelalv
1 Replies

7. Shell Programming and Scripting

Working of command

What does the command do lpr -Pqpr *.jpg do ? (1 Reply)
Discussion started by: Nabeel Nazir
1 Replies

8. Shell Programming and Scripting

Maxdepth command not working in AIX.Need alternative solution for this command

Hi All, I am trying to select 30 days older files under current directory ,but not from subdirectory using below command. find <Dir> -type f -mtime + 30 This command selecting all the files from current directory and also from sub directory . I read some documention through internet ,... (1 Reply)
Discussion started by: kommineni
1 Replies

9. UNIX for Dummies Questions & Answers

Shell script not working but command works in command prompt

Hi everyone I have a problem with my script If I try directly this command /usr/bin/nice -n 19 mysqldump -u root --password="******" wiki_schneider -c | nice -n 19 gzip -9 > /point_de_montage/$(date '+%Y%m%d')-wiki-db.sql.gz It works But if I simply add this command in a script and... (8 Replies)
Discussion started by: picemma
8 Replies

10. Shell Programming and Scripting

Execute ssh command with additional terminal command to any remote user not working script

Hello i am having an issue with bash script and this is the code now=$(cat hosts1.txt | awk '{print $2;}') while read n ;do ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers' When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies
Package::Stash::PP(3)					User Contributed Perl Documentation				     Package::Stash::PP(3)

NAME
Package::Stash::PP - pure perl implementation of the Package::Stash API VERSION
version 0.36 SYNOPSIS
use Package::Stash; DESCRIPTION
This is a backend for Package::Stash implemented in pure perl, for those without a compiler or who would like to use this inline in scripts. BUGS
o remove_symbol also replaces the associated typeglob This can cause unexpected behavior when doing manipulation at compile time - removing subroutines will still allow them to be called from within the package as subroutines (although they will not be available as methods). This can be considered a feature in some cases (this is how namespace::clean works, for instance), but should not be relied upon - use "remove_glob" directly if you want this behavior. o Some minor memory leaks The pure perl implementation has a couple minor memory leaks (see the TODO tests in t/20-leaks.t) that I'm having a hard time tracking down - these may be core perl bugs, it's hard to tell. Please report any bugs through RT: email "bug-package-stash at rt.cpan.org", or browse to <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Package-Stash>. SEE ALSO
o Class::MOP::Package This module is a factoring out of code that used to live here SUPPORT
You can find this documentation for this module with the perldoc command. perldoc Package::Stash You can also look for information at: o AnnoCPAN: Annotated CPAN documentation <http://annocpan.org/dist/Package-Stash> o CPAN Ratings <http://cpanratings.perl.org/d/Package-Stash> o RT: CPAN's request tracker <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Package-Stash> o Search CPAN <http://search.cpan.org/dist/Package-Stash> AUTHOR
Jesse Luehrs <doy at tozt dot net> Mostly copied from code from Class::MOP::Package, by Stevan Little and the Moose Cabal. AUTHOR
Jesse Luehrs <doy@tozt.net> COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Jesse Luehrs. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.18.2 2013-09-03 Package::Stash::PP(3)
All times are GMT -4. The time now is 09:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy