Sponsored Content
Full Discussion: Make directory in script
Top Forums UNIX for Dummies Questions & Answers Make directory in script Post 302602953 by Corona688 on Tuesday 28th of February 2012 06:46:48 PM
Old 02-28-2012
labs/* is redundant. Just do
Code:
tar -C labs -cf filename.tar .

And you can do
Code:
mkdir -p

which will be silent if the directory already exists.
This User Gave Thanks to Corona688 For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how do i make a new directory?

i know this is a pretty lame question, but im trying to ftp a file to a unix server - and i want to put it in a folder called "tmp" but when i try to do a " cd /tmp" it tells me there is no such folder. can someone tell me the command to create a "tmp" folder? thanks (3 Replies)
Discussion started by: raichuu
3 Replies

2. Shell Programming and Scripting

Need script to make big directory structure

Hi, I'm a novice and I'd like to make a directory structure with a hundred or so folders. I've tried mkdir /foo/foo1/etc... mkdir /foo/foo2/etc mkdir /foo/foo3/etc mkdir /foo/foo4/etc ...but it appends '@' to each folder name and then fails on the subdirectories. Is it better to use a... (2 Replies)
Discussion started by: kamur
2 Replies

3. Shell Programming and Scripting

make directory script

Hi, I try to write a script to create a new directory. #!/bin/bash echo "Please enter folder name (6 characters only) :" read foldername mkdir /home/user/$foldername $foldername >> /home/list/list.txt My question/situation: 1) how to ensure the folder name MUST BE 6 characters... (0 Replies)
Discussion started by: malaysoul
0 Replies

4. Shell Programming and Scripting

How Can I Make Subdirectories In A Directory?

I cant remember how, i use to know but its been like 2 years since ive used shell can anyone help me? (7 Replies)
Discussion started by: kprescod4158
7 Replies

5. Shell Programming and Scripting

check if a directory exists if not make it

Hey guys im trying to check if the directory exists i get a syntax error on the elif statement iv tried using else and still same result im not sure. If the directory does not exist can i just insert mkdir /tmp/old under the elif once that part gets working if ; then #do nothing elif echo... (20 Replies)
Discussion started by: musicmancanora
20 Replies

6. Shell Programming and Scripting

How to make a script to run everytime a new file is copied into a directory??

Hi folks I have a unix script script1 in a directory folder1 and also I have few input log files in this directory. My input log files will be copied into this directory folder1 from the portable thumb drive. Now what I want is I need to run this script1 whenever any new file is copied... (2 Replies)
Discussion started by: ks_reddy
2 Replies

7. UNIX for Dummies Questions & Answers

Make a script accessible from any directory

I wrote a small fortran program that I want to control with a bash script. The bash script builds a parameter file that is used by the fortran program. I want to make it so I can access the script from any directory on my computer. How do I do that? Or what key words should I search for to find... (1 Reply)
Discussion started by: C_James
1 Replies

8. UNIX for Advanced & Expert Users

Make a subdirectory the root directory

I have a series of configuration files to deliver to multiple unix environments (dev, test, bench, prod etc). However I don't to modify them for each environment. The files are text which currently contain this type of directory information IN=/DVT/ms/sas/reception/PIL_QPA_SID/GSPIN001... (5 Replies)
Discussion started by: clarcombe
5 Replies

9. Shell Programming and Scripting

Trying to make a bash script that goes through directory files and changes things

I'm trying to write a script in a directory that goes through the column the user specifies of 4 files that are inside the directory and calculates the min and the max values. This means that if the user specifies column 5, the script will go through column 5 of all 4 files and all that should give... (2 Replies)
Discussion started by: Eric1
2 Replies
ABS(3)							     Linux Programmer's Manual							    ABS(3)

NAME
abs, labs, llabs, imaxabs - compute the absolute value of an integer. SYNOPSIS
#include <stdlib.h> int abs(int j); long int labs(long int j); long long int llabs(long long int j); #include <inttypes.h> intmax_t imaxabs(intmax_t j); DESCRIPTION
The abs() function computes the absolute value of the integer argument j. The labs(), llabs() and imaxabs() functions compute the absolute value of the argument j of the appropriate integer type for the function. RETURN VALUE
Returns the absolute value of the integer argument, of the appropriate integer type for the function. CONFORMING TO
SVID 3, POSIX.1, BSD 4.3, ISO/IEC 9899 (C99). POSIX.1 (1996 edition) only requires the abs() function. ISO/IEC 9899:1990 (C89) only includes the abs() and labs() functions; the functions llabs() and imaxabs() were added in C99. NOTES
Trying to take the absolute value of the most negative integer is not defined. The llabs() function is included in glibc since version 2.0, but is not in libc5 or libc4. The imaxabs() function is included in glibc since version 2.1.1. For llabs() to be declared, it may be necessary to define _ISOC99_SOURCE or _ISOC9X_SOURCE (depending on the version of glibc) before including any standard headers. GCC handles abs() and labs() as builtin functions. GCC 3.0 also handles llabs() and imaxabs() as builtins. SEE ALSO
ceil(3), floor(3), fabs(3), rint(3) GNU
2000-12-17 ABS(3)
All times are GMT -4. The time now is 04:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy