Newbie problem with simple script to create a directory


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Newbie problem with simple script to create a directory
# 1  
Old 11-04-2008
Newbie problem with simple script to create a directory

script is:

dirname= "$(date +%b%d)_$(date +%H%M)"
mkdir $dirname

should create a directory named Nov4_

Instead I get the following returned:

root@dchs-pint-001:/=>./test1
./test1: Nov04_0736: not found.
Usage: mkdir [-p] [-m mode] Directory ...
root@dchs-pint-001:/=>

TOO easy, but what am I doing wrong?

Thx,
# 2  
Old 11-04-2008
Remove the space; should work

Code:
$ dirname="$(date +%b%d)_$(date +%H%M)"

# 3  
Old 11-04-2008
Thanks

it's always the little things Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script cannot create directory and move the file to that directory

I have a script, which is checking if file exists and move it to another directory if then mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly ... (9 Replies)
Discussion started by: digioleg54
9 Replies

2. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

3. Shell Programming and Scripting

Create simple script

Dear all, I have a directory named A and some subdirectories named B, C, D with .xml files. I want to use the following command to strip the file. sed -re ':start s/<*>//g; /</ {N; b start}' file.xml > file.xml At the same time, I want to remove the blank lines using sed '/^$/d' How can... (6 Replies)
Discussion started by: corfuitl
6 Replies

4. Shell Programming and Scripting

How to create a simple copy script?

Guys I want to do this: copy: /var/router/system1/config/backup/install.put /var/router/system2/config/backup/install.put /var/router/system3/config/backup/install.put /var/router/system4/config/backup/install.put into: /var/router/system1/config/install.dat... (22 Replies)
Discussion started by: DallasT
22 Replies

5. Shell Programming and Scripting

simple problem for a newbie

I am trying to find a way to display just sudoers, passwd and shadow files without the extensions.. Thank you for any suggestions ls -lrt /etc | egrep 'sudoers|passwd|group|shadow' -r-------- 1 root root 1338 Oct 31 2006 shadow.sav -r-------- 1 root root 5191... (4 Replies)
Discussion started by: delphys
4 Replies

6. Solaris

Problem when I try to create a directory on Solaris 8

Dear Gurus of solaris I have a problem when I try to create a directory when I enter in the /home/ directory and try to create a new directory appear the following error Why If I am root, Can any guru can help me (3 Replies)
Discussion started by: andresguillen
3 Replies

7. Homework & Coursework Questions

Create script to add user and create directory

first off let me introduce myself. My name is Eric and I am new to linux, I am taking an advanced linux administration class and we are tasked with creating a script to add new users that anyone can run, has to check for the existence of a directory. if the directory does not exist then it has... (12 Replies)
Discussion started by: pbhound
12 Replies

8. Shell Programming and Scripting

Simple Script to create folders

Hi I want to write a small script that will create folders named from `AAAA' all the way to `ZZZZ'. That is: `AAAA' `AAAB' `AAAC' ... `AABA' `AABB' `AABC' ... `ABAA' `ABAB' `ABAC' ... `ABBA' ... `ZZZZ' (4 Replies)
Discussion started by: ksk
4 Replies

9. Shell Programming and Scripting

Create A Simple GUI For Shell Script

Hi all! Im wondering if its possible to create a GUI for a shell script I just got done writing as the people that will be using it dont like the command line all to well. Just something simple with radio buttons to select options, maybe a text field to enter a location to save the file generated... (1 Reply)
Discussion started by: Grizzly
1 Replies

10. Shell Programming and Scripting

Newbie needs help with simple script

Hi, I'm just new here, looks like there is alot to read. I need some help on a simple script that i would like to make, and I honestly have zero experience with shell scripts or anything, so i have no idea what I am doing. I want to have a script that I can upload to to my webhosting... (12 Replies)
Discussion started by: shizizzle
12 Replies
Login or Register to Ask a Question