I have the below lines of code.
I m getting the below error while running the above script.
I tried this echo "APP_NAME="$APP_NAME>"{$APP_NAME}"_Deploy.cfg
This time i did not get the error but the .cfg files were not generated when they should.
Can you please help fix this.
Moderator's Comments:
Please use code tags consistently and correctly (not quote tags)!
Last edited by RudiC; 05-26-2016 at 06:20 AM..
Reason: Added / corrected code tags.
I have the below lines of code.
I m getting the below error while running the above script.
These lines are completely bogus anyways, there is little sense in debugging them.
You are doing a
and my suspicion is that you want to read the contents of all files named "found*.tmp" mince that through your while-loop. What you do in fact is to expand "found*.tmp", which will give you a list of files, something like
then you present this list to "ls", which will do nothing more than list it (again), resulting in this list:
Notice that the only thing "ls" has done for you is to convert the separating spaces to linefeeds. Now, you take one after the other of these filenames and present them to sed, as input files, one after the other and every time you invoke sed in a separate subshell.
May i ask you a personal question: if you go to a chinese restaurant, do you call the waiter separately for each order of a single grain of rice or do you call him once and tell him to bring "the big rice plate, with everything on it"? Because this is like you treat poor old sed in your script: instead of presenting it a single stream to work on you call it once every time you got some characters to process.
Here is how you can do the same in perhaps a fraction of the time:
This line will have the same limitations your original would have had, if you would have written it syntactically correct: it will only work correctly if there is only one "<name>...</name>" tag pair on every single line of input and none of these pairs span more than one line. Also, the script takes no caution for superfluous spaces. The following lines anywhere in your input will make the commands output probably not what it is intended to be and/or unusable (just like your script, would it have been correct):
I hope this helps.
bakunin
Last edited by bakunin; 05-26-2016 at 04:39 PM..
These 2 Users Gave Thanks to bakunin For This Post:
hi all,
i had the below script
filename = /osa/data1/output.txt
printf '%27s%53s\n' ' CURRENT DATE' 26-08-2014 >> $filename
iam getting the ambigiuos redirect error in the 2nd line of the code...please guide me
regards,
vasa saikumar (3 Replies)
Hi,
I need help on following linux bash script. When I linux commands for loop or while loop on individual file it runs great. but now I want the script to run on N number of files so it gives me ambiguous redirect error on line 12 and syntax error on line 22 : (pls help );
#!/bin/bash
#... (16 Replies)
This script has ambiguous redirect error.
...
cd $HOME
cd folder/work
# search all subfolders in work directory
find -mindepth 1 -maxdepth 1 -type d | while read directory
do
CUR_FOLDER="${directory#"./"}"
cd $CUR_FOLDER
chmod 644 *
for ff in *; do
if ; then
... (5 Replies)
hi,
i want to redirect my output & error if generated to two different files. I
have written the code for redirecting the output, i dnt have ne idea how to
go abt it for errors. I tried spooling which was given in one of the
threads on this forum.But it didn't work.The script i wrote as a lot... (4 Replies)
Hi everyone, While I was trying to do
DATE=`date +"%Y%m%d_%H%M%S"`
STARTLOG=$TUXSTDDIR/start_$DATE.log
tmboot -y > $STARTLOG 2>&1
I got an error i.e. Ambiguous output redirect error. Here the first part is to boot the account so there is nothing wrong with that.... (6 Replies)
Hi all,
Maybe my question is too simple but till now i couldn't figure about a solution :(
I have a bash script scheduled in cron:
<cron time parameters> my_script.sh > result.log 2>&1
By this way i can have standard output and standard error in my result.log file
Now i want my script... (2 Replies)
Hello,
I have a java program which i am calling in shell script. I wanted to redirect output to 2 differetn files. Output should have both 1 & 2 (normal and error) in both file.
pls help (2 Replies)
Hi,
I am new in shell scripting.
Can anyone point out what wrong of below script.
If I want the error output to "sqlerror.log"
and database pool data output to "bulk_main.dat".
Right now, the below script, if successful execute, the data will output to
bulk_main.dat && sqlerror.log both... (7 Replies)
Hi, I use this function (now modified with elif) for check if a pc is up: check_pc() {
$PING $PC 1 2> /dev/null
if ; then
check_dir #Other function
echo "Begin backup operation for $PC"
echo "$SMBTAR -s $PC -u $USER -p $PASS -x $SHARE$EXCL -t - | gzip -c >... (3 Replies)
Hi,
I was trying to cat some files but not all of them exist.
I would get some messages like below:
cat: cannot open /mil2_usr1/time_logs/investigator/6334
cat: cannot open /mil3_usr1/time_logs/investigator/6334
cat: cannot open /mil3_usr1/time_logs/investigator/6352
I don't want to see... (1 Reply)