| | |
Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
What am I doing wrong?
It just gives me: sed: No input files
bash Syntax (Toggle Plain Text)
for filename in /home/darragh/public_html/test/* do sed -i 's/..\/config/.\/config/g' done;
It just gives me: sed: No input files
Forgetting to give the filename to sed:
Shell Scripting Syntax (Toggle Plain Text)
for filename in /home/darragh/public_html/test/* do sed -i 's/..\/config/.\/config/g' ${filename} done;
Okay that is probably right, but now it says I don't have permission, which is right because I made those files as root, but if I do
What to do know?
sudo for ... then it says unknown command for...What to do know?
Run the script as root or modify your script. 'for' is just a bash command for looping what you need elevated privelages for is possibly the 'ls' and the sed:
Shell Scripting Syntax (Toggle Plain Text)
for filename in `sudo /home/darragh/public_html/test/*` do sudo sed -i 's/..\/config/.\/config/g' ${filename} done;
![]() |
Similar Threads
- [Bash] problem with script in sed command (Shell Scripting)
- replacing text with sed (Shell Scripting)
- EXHAUSTED... using sed and back references (Shell Scripting)
- Help with SED/AWK email parser (Shell Scripting)
Other Threads in the Shell Scripting Forum
- Previous Thread: logarithmic expression how to calculate?? Please help
- Next Thread: Log file analysis based on time range
| Thread Tools | Search this Thread |






