permission denied when sed in place edit in mingw
It's caused by Windows security settings.
Open the folder's Properties settings from the context menu. In the Security tab, click Edit, press Add... in the pop-up window and add your user to the list, check Full Control in the Allow column. Press OK twice to apply the changes.
What causes Permission denied when using sed?
Is $config_out
the name of a file or a command? If it's a file, then you need to either cat $config_out | sed ...
or sed ... < $config_out > $config_out.tmp
. If it's a command, though, the first command might have truncated/overwritten whatever it was (shell script or perl script or something?).
Permission denied error using sed to change file name
You want to force evaluation on basename-sed pipe. ( with '$(' ) and handle the quoting)
outputname=$(basename $file | sed -e "s/_Aligned.sortedByCoord.out.bam/_.gtf/")
Or using Bash built-in only, which will be much FASTER.
file_base=${file##*/}
outputname=${file_base/_Aligned.sortedByCoord.out.bam/_.gtf}
find and rename files gives bash 'no such file or directory' error
Probably you don't have rename
command on your system. Try this instead:
for file in ./*.json; do
echo mv "$file" "${file%-*}.json"
done
Drop the echo
if the output looks fine.
Related Topics
Possibly Undefined MACro: Ac_Prog_Libtool
How to Find List of Odbc Drivers Installed on Linux
Gdb Warning: Loadable Section Not Found in Added Symbol-File System-Supplied Dso at 0X7Ffff7Ffd000
How to Replace a Multi Line String in a Bunch Files
Add Suffix to Each Line with Shell Script
Best Way to Make Linux Web Services
How to Narrow Down Perf.Data to a Time Sub Interval
Zipping Without Creating Parent Folder
Cannot Make Bash Script Work from Cloud-Init
Padding Empty Field in Unix Join Operation
Anaconda Libstdc++.So.6: Version 'Glibcxx_3.4.20' Not Found
Rsync --Exclude Not Excluding Specific Files
Scp: How to Find Out That Copying Was Finished
What Happened to Socket If Network Has Broken Down
Dbus_Bus_Request_Name (): Connections Are Not Allowed to Own the Service