Welcome to the forum and the beautiful world of shell scripting.
It is always a nice idea, though, to try and provide a sample snippet from your code so that our fellow advisers and coaches can get a better understanding. Plus, if there are any more enhancements or better versions for your code, they can suggest that as well.
That is rather astonishing, because for me that works.
Anyway, you could always fall back to a basic loop. Not quite as elegant, but does the work:
Notice, though, that this will fail if you have several names on one line, because they will be treated as ONE name. A line of "one two three" will not create three directories "one", "two", "three" but one directory "one two three" (yes, with the blanks as part of the name).
Neo: here is the code in this attachment - this is spam which should be deleted
I hope you can see the picture. There is like a "whitespace character" after 2 of the 3 created directories.
---------- Post updated at 03:47 AM ---------- Previous update was at 03:44 AM ----------
This is the picture:
Moderator's Comments:
Neo: deleted post of the spam below ...
---------- Post updated at 03:55 AM ---------- Previous update was at 03:47 AM ----------
Sorry that the picture does not appear.
Anyway, the first text option
is ok for me. I can manage to get the text like this.
Very interested also in the loop option, but I think I need to learn the language first before being able to use it.
Thanks to all!
I hope you can see the picture. There is like a "whitespace character" after 2 of the 3 created directories.
The internet does not work that way. Sending someone else a link to "c:\users\fejoz\desktop\ttt.jpg" does not make them see your computer. You can't dump it in 'image:' contents either, not on a bbpost, only a webpage. Look for the 'attachment' button next time you want to send an image here.
But given a c:\ link, I can guess what that "whitespace character" was. You've been editing scripts and data files in Microsoft Notepad, which fills them with garbage: carriage returns. Windows ends lines on \r\n, Linux just uses \n, so the \r becomes garbage at the end of every line. xargs did exactly what you told it to. So will most other methods unless you explicitly exclude carriage returns from names somehow. Garbage in, garbage out.
To remove carriage returns from your files:
inputfile and outputfile must not be the same.
Last edited by Corona688; 11-23-2017 at 11:30 AM..
I was trying to copy the files inside the path /home/user/check/Q1/dir/folder1/expected/n/a1.out1 and a1.out2 and a1.out3 to /home/user/check/Q2/dir/folder1/expected/n/
if n directory is not present at Q2/dir/folder1/expected/ then directory should be created first. And, script follow the... (5 Replies)
To bakunin and corona688:
My result when text in file is
ms_ww_546
ms_rrL_99999
ms_nnn_67_756675
is
https://www.unix.com/C:\Users\Fejoz\Desktop\ttt.jpg
I hope you can see the picture. There is like a "whitespace character" after 2 of the 3 created directories.
---------- Post... (0 Replies)
Gents,
Please can you help.
I want to create a list which contends the complete patch of the location of some directories with the size of each file.
need to select only .txt file
In this case I am try to find the subdirectories tp1 and tp2 and create the output list.
jd175-1
tp1... (3 Replies)
Hello everybody, I wonder if there's a way to make a directory that contains multiple subdirectories. For example, if I want to make /home/student under the current working directory, how do I do it? Can I do it using a single mkdir command or do I have make home first, cd into it and then make... (1 Reply)
Is is possible to create the directories in following manner.
for example my home dir is empty
and i want to create dir a/b/c
mkdir a/b/c # where a/b does not exists. (5 Replies)
I am very new to BASH and I am having difficulties moving a long list of image files into similarly named directories. I've been trying to come with a script all night and no luck. Here is what my list of files looks like:
DSC_0059_01.jpg
DSC_0059_02.jpg
DSC_0059_03.jpg
DSC_0059_04.jpg... (5 Replies)
I'm looking to archive a client directory from a CIFS share
There are multiple directories that will be stored in a text file and I'm looking to
create an individual tar archive of each folder in the directory.
I've tried a number of commands to no avail.
Here's what I would like.
... (2 Replies)
Hi, I have network mount on two servers.
One server I can create any directories without any issues, other server with the similar mount, I am not able to create directories starting with number!
Creation, name start with a number:
$ mkdir 1212
mkdir: cannot create directory `1212': No such... (12 Replies)
Hi,
I have an AIX machine. I am trying to create a directory from within the script, but the message being shown is "mkdir: 0653-358 Cannot create directory 'xxx': A file or path name is too long"
I am not giving any 'long' pathname to mkdir. The commands being issued within the script are:
... (0 Replies)