Sponsored Content
Operating Systems Linux Red Hat Script creates additional file Post 303000810 by anaigini45 on Thursday 20th of July 2017 06:23:15 AM
Old 07-20-2017
Script creates additional file

Hi,

I have created a test script like this :

Code:
[root@L28tstream1 ~]# cat script1.sh
DAY=$(date +%d)
MONTH=$(date +%b)
YEAR=$(date +%Y)
BC01="Blast_BC01"
BC15="Blast_BC15"
DIR1="$MONTH$YEAR_$BC01"
DIR2="$MONTH$YEAR_$BC07"
DIR3="$MONTH$YEAR_$BC15"

if [ "$DAY" > 15 ];then
        mkdir -p "$YEAR/$DIR3"
fi
[root@L28tstream1 ~]#

When I execute the script, the directories I want is created, i.e :
/root/2017/JulBlast_BC15

However, and additional files is also created. The file name is "15" :

Code:
drwxr-xr-x 3 root root    4096 Jul 20 18:06 2017
-rw-r--r-- 1 root root       0 Jul 20 18:06 15
[root@L28tstream1 ~]#


Why does this file get created? And how do I prevent it from being created?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed in script creates output file ending with '?' (^M)

Hi, I'm trying to use sed within a shell script (bash, running ubuntu). The command works fine from the command line, but when I use it within the script, rather than creating a file with the name I've specified, it creates one that ends with a question mark '?' when you use ls, e.g.... (3 Replies)
Discussion started by: jennykay
3 Replies

2. Shell Programming and Scripting

awk script creates empty line

I have the following awk script to which I pass the file > 10 0 0 10 0 0 > 12.997 0 5.71132 12.9098 0.0687626 5.48855 12.7506 0.174324 5.13225 12.5913 0.262662 4.80643 12.4316 0.335652 4.50283 12.2717 0.394598 4.21542 12.1113 0.440399 3.93957 11.9506 0.473646 3.67148 11.7894... (2 Replies)
Discussion started by: kristinu
2 Replies

3. Shell Programming and Scripting

Script sometimes creates an empty file

I have a script that runs ditto for me, and occasionally (if I exit the script while ditto is running in the background) it will leave an empty file named 0 in the script's directory. The next time I run the script, it generates incorrect data because of this file. I know I can easily insert a... (1 Reply)
Discussion started by: reid
1 Replies

4. Shell Programming and Scripting

Script sometimes creates an empty file

I have a script that runs ditto for me, and occasionally (if I exit the script while ditto is running in the background) it will leave an empty file named 0 in the script's directory. The next time I run the script, it generates incorrect data because of this file. I know I can easily insert a... (1 Reply)
Discussion started by: reid
1 Replies

5. Shell Programming and Scripting

Script that creates directory structure

Hi All, I have a script that does daily checks on my storage environment and is run from an AIX host. The script currently works great but I have been changing and updating bits of it to make it easier for my lesser colleagues to understand :p However now with the updates I have made I... (1 Reply)
Discussion started by: colinwilson1303
1 Replies

6. Shell Programming and Scripting

Extraction of .tar.gz creates additional unwanted directories

I'm working on a project that requires me to compress then relocate directories to a different location based on their last date of modification. After running the script I check to see if it worked, and upon unzipping the tar.gz using I created everything that should be there is. I then performed... (4 Replies)
Discussion started by: jrymer
4 Replies

7. Shell Programming and Scripting

Lock file creates with '?'

Hi, I am trying to create a lock file with the following code but for some reason after file is created it has wrong name "PASP?.lock??" Please let us know how to get rid of these '??' from file name and from where they are coming? #!/bin/ksh... (6 Replies)
Discussion started by: sandy162
6 Replies

8. Shell Programming and Scripting

Writing a script that creates a 1GB file with zeros using dd

I am new to Linux. Using latest version of Ubuntu. I want to make a script that creates a 1GB file filled with zeros using dd and then formats the file as vfat with a label of "MYFILE". If anyone can help me it would be appreciated. (9 Replies)
Discussion started by: paviter619
9 Replies

9. Shell Programming and Scripting

In the script I get additional file, which I don't expect do get

I have the following script #!/bin/sh Usage () { echo "Usage: $0 <config_file>" echo "Example: ./sftp_ondemand_daily.sh /export/data/mbsesb/config/ond emand.cfg /export/data/mbsesb/config/filename.lst" exit 1 } if then Usage fi ... (6 Replies)
Discussion started by: digioleg54
6 Replies

10. Shell Programming and Scripting

Writing a script that creates a 1GB file with zeros using dd

I am new to Linux. Using latest version of Ubuntu. I want to make a script that creates a 1GB file filled with zeros using dd and then formats the file as vfat with a label of "MYFILE". If anyone can help me it would be appreciated. (1 Reply)
Discussion started by: amandasaza08
1 Replies
ppmtosixel(1)                                                 General Commands Manual                                                ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 11:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy