ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to make a batch command set that will convert files from .NEF to .jpg and place them in a directory with the same name as the parent + jpg attached to the end within the parent directory.
Code:
mkdir $(name of parent directory + jpg) # ie /test would now contain /testjpg as a sub directory#; ufraw-batch --out-type=jpg *.NEF ; mv *.jpg testjpg
Running the command set in a directory called photos with files 001.NEF, 002.NEF would create directory photosjpg within photos containing the files 001.jpg and 002.jpg. The original .NEF files would remain in photos.
that makes testjpg a sister directory to test, not a child of test which is what I want, but many thanks
Actually that is incorrect. $PWD stores the name of the directory you are in, hence issuing the command would result in a directory being created as a child
Actually that is incorrect. $PWD stores the name of the directory you are in, hence issuing the command would result in a directory being created as a child
I know what you are saying and I agree with you but I am passing on what I am getting. I am issuing the command from within the directory /home/test and it is creating /home/testjpg.
Code:
Study@Study:~$ ls
Accounts Library test
Calibre Library Mail The Blues Brothers (1980) [1080p]
Desktop Music The Usual Suspects
Documents MUSIX_GNU+Linux_3.0rc1 vids
Downloads MyMachines VirtualBox VMs
Dropbox Pictures workspace
Holidays Scrabble
Jobs Shared
kde3-backup sketchbook
Study@Study:~$ cd test
Study@Study:~/test$ mkdir "${PWD}jpg"
Study@Study:~/test$ ls
tect.txt
Study@Study:~/test$ ls ..
Accounts Library test
Calibre Library Mail testjpg
Desktop Music The Blues Brothers (1980) [1080p]
Documents MUSIX_GNU+Linux_3.0rc1 The Usual Suspects
Downloads MyMachines vids
Dropbox Pictures VirtualBox VMs
Holidays Scrabble workspace
Jobs Shared
kde3-backup sketchbook
Study@Study:~/test$
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.