I’m having a problem with the copy command. cp ../teste/env/test/x.tar ../../../teste2/file The folders exist and also the file x.tar. When I start the script I’m on a different folder, so that’s why I make a ../ at the begining. It keeps giving me this error: cp: cannot create regular file ‘../../../teste2/file’: No such file or directory Worth to note that
Tag: sh
How to open apps from bash (Linux)
Automate part of your life where you can! (It doesn’t seem to be working properly…). This time is for opening multiple apps on my desktop while I make my morning coffee. I created a .sh to open my workspace apps like Visual Code, Slack, Firefox, etc. The script is basically: I basically found the paths to the executable apps and
Executing single shell script parallelly at same time with different arguments
Consider a script lets say test.sh which accepts file no as argument which process huge files based on argument. So whenever I am executing it as “nohup ./test.sh 01 &” it does the job, I have requirement where same needs to be executed parallelly for 8 files and I am able to achieve that with different arguments. Following are my
Shell Script : MongoDB Dump
I’m creating a shell script to automatically dump the database. I have the current code below. The problem is when I’m opening the zip file it shows a single binary file. Usually, when I dump manually it consists of bson and json files. I don’t know what I’m doing wrong I’m expecting a zip file with bson and json file.
pass the date from outside as a parameter
This is my Linux script, I want to ask the user from outside what date is needed, then save that date and run the script for that date. now currently this script generate a csv for the current date files, I want to run this for a user request date, can I pass parameters from outside? any help could be
How to convert this powershell script to bin/sh script?
How to convert this script: or with parameter: How to make similar script that works in linux /bin/sh? I want to copy files to some network location (windows shared folder). There is no scp on windows server and i cannot install anything. Answer On Linux, you’ll need the following (verified on Ubuntu 18.04, albeit not with a Windows domain account):
Why print empty path in shell script?
samuel@:~/…/linux$ ./test.sh find . -type f -name “*” samuel@:~/…/linux$ How do I fix this to get find . -type f -name “*” ‘s result? Answer I suggest to use an array:
How do I correct this printing out copied files from directory in Unix Bourne Shell?
So i need to write a Unix Bourne Shell to to copy all the files from the directories named dir1 and dir2 into a new directory named dir3. The script first copies all the files from dir1 into dir3. The script then copies every file from dir2 to dir3 subject to these conditions: if the file from dir2 is not
How to get information from file with condition in Shell script without using “awk” [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question i have file conditions : if the 2nd column is – then 2nd condition check last column value beginning in
Need a way to check content of file (time data) is more than 5 minutes or not
I am creating a script to pull out the list of highest cpu consuming jobs on my server. I am taking the dump of processes in a flat file in below format: 202009080230,4.1,218579,padaemon,02:30,00:00:01,SD_RCC_FRU:wf_rcc_ds_CRS_FactSuspendedGdc_d.s_m_rcc_ds_Staging_Dimension_FactSuspendedGdc_ipi_d The second data point(4.1) is my cpu utilization while the sixth one is the time taken(00:00:01). I intend to filter out only the entries from this file