Its giving me error
$ ./roottelnet.sh
./roottelnet.sh: line 2: syntax error near unexpected token `$'do\r''
'/roottelnet.sh: line 2: `do
Hello sharp488,
Seems you may have carriage characters in your script which you are using, could you please use following command to confirm the same.
Where Input_file is your script name. If you are seeing control M characters there like as an example as follows.
If you find above control M characters into your script then you could try following to remove them.
Then you could try to run your script. Kindly do let us know if you have any queries on same.
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies
2. Post Here to Contact Site Administrators and Moderators
Variable I have in my shell script
diff=$1$2.diff
id=$2
new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk -F'~' ''$2 == "$id"' {print $0}' > $new
I could see value of $id is not passing to the awk... (0 Replies)
Hi,
I'm trying to extract information from one file to update another one and am a bit stuck.
the first file is made up of tags e.g.
<item>a@b.com</item>
jksdhfjkdsh sldkjfds l klsjdf
<item> c@d.com </item>
what i'd like to do is extract the email addresses between these tags,... (6 Replies)
# for i in `cat oo`;do ls -ld $i;done
ls: /var/tmp/i: No such file or directory
ls: i: No such file or directory
ls: /var/tmp/ii: No such file or directory
ls: i: No such file or directory
ls: /var/tmp/iii: No such file or directory
ls: i: No such file or directory
ls: /var/tmp/iiii: No such... (2 Replies)
Hi All,
I have Information in the file like,
============ Interface Information ====================
+++++++++++++++++ NMInterface ++++++++++++++
ObjID:251c55a2-2257-71dd-0f68-9887a1f10000
NNMObjID:82857
EntityName:aust00m1.mis.amat.com ]
Description:ATM9/0/0-atm layer
Discovered in... (22 Replies)
I have a shell script which takes at the command prompt options like
ss1.sh -F SCOTT -T JOHN
F- From User
T- To User
I want to pass the From User(SCOTT) Value to another script
ss2.pls (This script runs a PL/SQL Program). Depending on the FromUser value in the ss1.sh script i have to... (4 Replies)